Performance of this deep equal implementation is generally proportionally between 5x slower and 700x slower compared to native deepStrictEqual
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
- 领域
- performance
调研方向
从 src/tests/self.ts 第 324-386 行附近的基准测试开始,使用原生 deepStrictEqual 重现其中的比较。针对报告中的数组和对象用例分析 deep-equal 的实现,然后使用同一基准测试验证任何性能变化,并确认正确性保持不变。
由索引模型根据 Issue 内容生成。
描述
I have a test implemented here using my test/benchmark library. I've also taken the plot that this generates and hosted it publicly on the net here: https://unphased.github.io/static-sharing/2024-03-29/deepequal_perf/deepequal_perf_collisions.html
I like this method of sharing benchmark results in HTML format since the plot made with uplot allows for interacting with series and zooming in.
The general summary based on the above plotting is that although this deep-equal implementation does not have an asymptotic algorithmic shortcoming compared to the builtin (as demonstrated by the straight lines in the first plot), it is consistently between 5x slower (if I compare large arrays filled with integers) and 700x (!!) slower (if I compare large arrays filled with objects). Obviously being implemented in js as opposed to presumably C++ will necessitate a 2-10x performance hit, something seems suboptimal here because this is a lot slower than that.
I first became aware of the issue being in this library by seeing it show up in the chrome profiler. I haven't reviewed the code yet, but based on the flamegraph that I saw, the implementation appears to be a recursive one. And that doesn't bode well for performance, but I would expect even a recursive implementation to be faster than what I'm seeing.
Please let me know if any of this is unclear.
- 主要语言
- JavaScript
- 星标
- 792
- 派生
- 107
- 平均合并
- 9 天 20 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
inspect-js/node-deep-equal 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
inspect-js/node-deep-equal#112 ·
-
难度 4/5 3-5 天 新手友好度 35/100
inspect-js/node-deep-equal#110 ·
-
难度 3/5 1-2 天 新手友好度 25/100
inspect-js/node-deep-equal#108 · 5 条评论 ·
-
难度 4/5 3-5 天 新手友好度 15/100
查看 inspect-js/node-deep-equal 的全部 Issue
相似的 Issue
-
status: ready
难度 2/5 1-3 小时 新手友好度 64/100
melodic-software/claude-code-plugins#15008 · 1 条评论 ·
维护者通常 1 天内回复
-
S-Needs triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
ACK_WAITING HELP_WANTED UPDATE_CS
难度 2/5 1-3 小时 新手友好度 83/100
OWASP/CheatSheetSeries#2935 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
docs-external-links-failure
难度 2/5 1-3 小时 新手友好度 65/100
ComposioHQ/composio#5297 ·
维护者通常 1 天内回复