Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION]: Why does ORM-style API seem to outperform MilvusClient in database search operations? #2079

Open
1 task done
cococo2000 opened this issue May 9, 2024 · 0 comments
Labels
kind/question A question to answer

Comments

@cococo2000
Copy link

cococo2000 commented May 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What is your question?

I installed milvus (v2.4.1) standalone with docker compose following https://milvus.io/docs/install_standalone-docker-compose.md. and I tried to test milvus performance with mnist dataset , HNSW index and L2 distance.

However, I found that the ORM-style API seems to outperform MilvusClient in database search operations.

First, I followed the Hello-Milvus tutorial and hello_milvus.py in milvus-docs using MilvusClient.

from pymilvus import MilvusClient, DataType

client = MilvusClient(
    uri="http://localhost:19530"
)

...

But, I found that the QPS was only around 4. Then, I tried to use ORM-style API following hello_milvus.py in pymilvus and the QPS was over 150 which is much higher than MilvusClient.

from pymilvus import (
    connections,
    utility,
    FieldSchema, CollectionSchema, DataType,
    Collection,
)

connections.connect("default", host="localhost", port="19530")

collection_name = "test"
if utility.has_collection(collection_name):
    utility.drop_collection(collection_name)
...

I'm not sure why ORM-style API runs much faster than MilvusClient. Could you provide some insights on this?

Anything else?

No response

@cococo2000 cococo2000 added the kind/question A question to answer label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question A question to answer
Projects
None yet
Development

No branches or pull requests

1 participant