Repository navigation
feat(benchmarks): organize subsystem suites and add inverted microbenchmarks - #908
Merged
Merged
Conversation
zhourrr
requested review from
Cuiyus,
JalinWang,
egolearner and
feihongxu0824
as code owners
November 16, 2026 06:54
Move the FTS and vector benchmark suites into a dedicated benchmarks module while preserving their targets and behavior. Replace BUILD_TOOLS with the opt-in BUILD_BENCHMARKS option and update CI, build scripts, packaging, and CODEOWNERS. Document subsystem workflows and use build-bench for isolated build output.
zhourrr
force-pushed
the
feat/invert_benchmarks
branch
from
November 17, 2026 12:46
b7e6211 to
4cd8e0a
Compare
Align workload options, simplify query timing metrics, and retain only failed phase logs. Fix cross-platform paths, terminal colors, and vector<bool> shuffling.
Measure inserts after each batch is decoded. Report observed value distributions and mean matches per query, and document how to run and interpret the benchmark.
iaojnh
requested changes
Nov 18, 2026
iaojnh
left a comment
Collaborator
There was a problem hiding this comment.
有两个问题建议合并前处理:
-
[P2] 独立运行
query时会绕过verify。QueryNumeric()只检查了索引路径和数据描述,没有检查校验结果。Python 驱动会在verify失败时停止,但 README 也支持直接运行 C++ 的各个阶段。本地复现:构建后让索引与源数据不一致,verify返回1,随后query仍返回0并生成query.json。建议verify成功后写入与本次索引、数据和查询参数绑定的校验记录,query只有在记录匹配时才开始计时。 -
[P3] 原始 JSON 在汇总前就舍入了计时结果。
WriteJson()对所有浮点数使用fixed和两位小数。例如,96 ms 和 104 ms 的构建耗时都会写成0.10 s,Python 汇总时已经无法区分。建议原始 JSON 保留浮点精度,只在渲染report.md时舍入。
Collaborator
Author
|
@iaojnh 感谢复现并指出这两个问题。针对这次 review,说明一下当前的设计取舍。
|
iaojnh
self-requested a review
November 18, 2026 04:52
iaojnh
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
将现有 FTS 和 vector benchmark 从
tools/迁移到独立的benchmarks/模块,并新增面向 INT32/INT64 的倒排索引 microbenchmarks。BUILD_BENCHMARKS=ON显式启用构建,替代原来的BUILD_TOOLS,默认关闭;同步更新 CI、构建脚本、打包配置、CODEOWNERS 和文档。验证:本地 Debug 构建通过;12 个 C++ 测试和 28 个 Python 测试通过。C++ 测试覆盖 72 种 numeric 配置组合,每组使用 10 万文档。另已完成 72 组 1 千万文档的 benchmark,每组重复 3 次。Ruff 0.14.4、clang-format 18.1.8 和 diff 检查通过。
数值索引查询性能参考
在同一台 macOS arm64 机器上,用 workload 40 的 1,000 万条 INT64 记录分别与 SQLite 3.53.3 和 Qdrant Edge 0.9.0 对照。每次对照都重新测量了 zvec。数值均匀分布在 0–29,999,按文档 ID 打散,无 NULL。逐行核对了文档 ID 和数值,也核对了每个查询参数的命中数。原始 benchmark 报告中的 workload 40
v < 300v < 15006表中为单次精确过滤计数的平均耗时。每次测试使用一个查询线程,每个参数执行 100 次,共 3 轮。zvec 查询倒排索引并读取结果位图的基数,SQLite 通过原生 C API 在读事务内使用覆盖索引执行
COUNT(*),SQL 预编译和参数绑定均在计时前完成。SQLite 对照中,等值命中耗时接近,zvec 的两条范围计数查询更快。Qdrant Edge 使用一个 segment,整数索引同时启用等值和范围查询,覆盖全部 1,000 万条记录。过滤条件在计时前构造,计时包含通过进程内 Python 绑定调用 Rust 引擎的开销。
exact=true会收集匹配的点 ID、去重并计数。命中 4,999,849 条时,zvec 和 Qdrant Edge 的平均耗时分别为 6.16 ms 和 432.16 ms。Qdrant Edge 精确计数实现English
Move the existing FTS and vector benchmarks from
tools/into a dedicatedbenchmarks/module, and add inverted-index microbenchmarks for INT32/INT64.BUILD_TOOLSwith opt-inBUILD_BENCHMARKS=ON, disabled by default. Update CI, build scripts, packaging configuration, CODEOWNERS, and documentation.Validation: local Debug build passed; all 12 C++ tests and 28 Python tests passed. C++ coverage includes 72 numeric configurations at 100K documents each. A full run also covered 72 workloads at 10M documents each, with three repetitions per workload. Ruff 0.14.4, clang-format 18.1.8, and diff checks passed.
Numeric query performance reference
We compared zvec with SQLite 3.53.3 and Qdrant Edge 0.9.0 in two separate runs on the same macOS arm64 machine, measuring zvec again for each comparison. All engines used workload 40’s 10 million INT64 values, uniformly distributed over 0–29,999, shuffled by document ID, with zero NULLs. We checked every document ID and value after import and compared match counts for each query input. Workload 40 in the original benchmark report
v < 300v < 15006The table shows mean latency per exact filtered count. Each engine used one query thread and executed each input 100 times in each of three rounds. zvec searched the inverted index and read the result bitmap's cardinality. SQLite executed
COUNT(*)over a covering index through its native C API in a read transaction, with statements prepared and parameters bound before timing. In the SQLite comparison, equality hits took similar time and zvec was faster for both range counts.Qdrant Edge used one segment with integer lookup and range indexing enabled for all 10 million points. Filters were constructed before timing. The timings include the call through the in-process Python binding to the Rust engine. With
exact=true, Edge collects and deduplicates matching point IDs before counting them. At 4,999,849 matches, zvec averaged 6.16 ms and Qdrant Edge averaged 432.16 ms. Qdrant Edge exact-count implementation