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

Takes longer time than Python client on get_points #131

Open
CrazyboyQCD opened this issue May 29, 2024 · 0 comments
Open

Takes longer time than Python client on get_points #131

CrazyboyQCD opened this issue May 29, 2024 · 0 comments

Comments

@CrazyboyQCD
Copy link

OS: Windows11

rust(release ~308ms):

use anyhow::Result;

use qdrant_client::prelude::*;
#[actix_web::main]
async fn main() -> Result<()> {
    let client = QdrantClientBuilder::default().build()?;
    let collection_name = "test_collection";
    let t = std::time::Instant::now();
    client
        .get_points(
            collection_name,
            None,
            &[
                "211b0f43-1b8d-4d12-9dd3-62aa0f07a8c6".to_owned().into(),
                "bdd8a0a7-8f39-4b3e-9a92-7a8e2c6f0a4d".to_owned().into(),
                "9cda8e6d-6e0f-4e33-8a6b-2e3b13d6a2e2".to_owned().into(),
                "e9e6e4e9-3b69-4edf-9a5c-a9e8b4df8a66".to_owned().into(),
                "4f80c7a1-4f7b-4c79-94a4-8e20c3f6a1e3".to_owned().into(),
                "17b73663-3a8c-4e5d-9a7d-ec7bba2a8bcf".to_owned().into(),
            ],
            Some(false),
            Some(true),
            None,
        )
        .await?;
    println!("\n{:?}", t.elapsed());
    Ok(())
}

python(~270ms):

from qdrant_client import QdrantClient

client = QdrantClient(prefer_grpc=True)
t = time.time()
client.retrieve(
    "test_collection",
    [
        "211b0f43-1b8d-4d12-9dd3-62aa0f07a8c6",
        "bdd8a0a7-8f39-4b3e-9a92-7a8e2c6f0a4d",
        "9cda8e6d-6e0f-4e33-8a6b-2e3b13d6a2e2",
        "e9e6e4e9-3b69-4edf-9a5c-a9e8b4df8a66",
        "4f80c7a1-4f7b-4c79-94a4-8e20c3f6a1e3",
        "17b73663-3a8c-4e5d-9a7d-ec7bba2a8bcf",
    ],
)
print(time.time() - t)

I know it's minor but I wonder is it related with Tonic or client itself ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant