[0054] 优化 inlet 性能#801
Open
da-liii wants to merge 4 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- sublet_1 的 T_LET 分支中,仅在后面还有 entries 时才遍历找尾 - s7_inlet 添加空参数快速路径,直接返回 make_let 性能变化(6000 slot 大 inlet,100 次迭代): - copy big inlet: 0.0140s -> 0.0127s (-9%) - merge big inlet: 0.0119s -> 0.0105s (-12%) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
将各测试项运行时间控制在 0.01s ~ 1s 之间,减少测量噪声。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
在 inlet benchmark 中增加不同字段数量(2/4/16)的 record 创建、字段访问、类型判断及与直接 inlet 的对比测试。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
优化
inlet函数在大 let 复制和合并场景下的性能。Changes
src/s7.c:sublet_1的T_LET分支中,添加if (is_pair(cdr(entries)))判断,避免append_let后对最后一个 let 进行不必要的二次遍历s7_inlet的空参数路径:当args == sc->nil时直接make_let返回,跳过sublet_1调用bench/inlet-bench.scm: 添加 inlet 性能 benchmarkdevel/0054.md: 添加开发文档Benchmark 结果(6000 slot 大 let,100 次迭代平均)
Test plan
xmake b goldfish构建通过bin/gf bench/inlet-bench.scm性能测试运行正常🤖 Generated with Claude Code