Repository navigation
perf: reduce XDB result mapping allocations - #42
Merged
Merged
Conversation
yourtion
marked this pull request as ready for review
October 25, 2026 04:49
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.
XDB 每次命中后,标准结果映射会创建条件展开的临时对象和回调;raw 查询也会经过不需要的字段处理。现在在 adapter 内直接构建标准结果,并让 raw 模式直接返回。公共 API、列校验、缺失值规则、自定义列和结果对象独立性保持不变。
标准查询吞吐中位数,相对已合入 IP 解析优化的 main
4e5c346:同一 AMD EPYC Linux x64 主机、固定数据与 4,096 地址集,20,000 次预热、500,000 次吞吐查询、每组 5 个独立进程;120 个 worker 均校验全部记录及计时 checksum。不能直接与上一轮不同主机的绝对数值比较。
性能取舍:初始矩阵中 Bun 标准查询 p99 上升(IPv4 3.415→6.991 µs,IPv6 12.368→15.523 µs),尽管 p50/p95 和吞吐改善。额外 24 个同查询集 worker 显示预热敏感性;200,000 次预热后 p99 改善,但不证明 JIT/GC 原因,也不构成生产延迟保证。raw IPv6 在 Bun 基本持平,Deno 中位数 -4.3%,运行范围重叠。两份原始报告均保留,不主张所有指标都改善。
验证:75 项核心/独立参考/发布工具测试通过;Node 24.19.0、Bun 1.4.4、Deno 2.9.6 真实 tarball 消费验证通过,包含公开示例、ESM/CJS、声明、权限和数据哈希。oxlint、oxfmt、TypeScript 与 git diff --check 通过;基准源码/编译产物哈希与最终代码一致。