Takes longer time than `Python` client on get_points

未关闭
#131 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python, rust
领域
api, performance

调研方向

从 Rust 客户端的 get_points 入口点开始,使用与 issue 中相同的 collection 和六个 point ID 重现 Windows 11 对比。调查客户端层和 Tonic 层的同时,将 Rust release 的时序与 Python 的 retrieve 调用进行比较。当时序差异得到可复现的解释,并且相关的后续工作范围已记录在案时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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 ?

主要语言
Rust
星标
425
派生
89
平均合并
2 小时 48 分钟
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

qdrant/rust-client 的其他 Issue

查看 qdrant/rust-client 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。