Skip to content

Improve list join performance - #171

Merged
liufengyun merged 4 commits into
mainfrom
improve-list-join
Oct 19, 2026
Merged

liufengyun merged 4 commits into
mainfrom
improve-list-join

Conversation

@liufengyun

Copy link
Copy Markdown
Member

Improve list join performance

No API change, only performance improvement.

Summary

The change removes repeated copying of the accumulated prefix in List.join, using native array joining after rendering each element once.

Backend Separator Elements Before (ms) After (ms) Change
Ruby "" 200,000 7,520.2 242.3 31.0× faster
Ruby "," 200,000 16,140.7 250.2 64.5× faster
Python "" 200,000 271.9 281.7 3.6% slower
Python "," 200,000 8,357.1 262.4 31.9× faster
JavaScript "" 200,000 41.6 13.0 3.2× faster
JavaScript "," 200,000 63.1 25.3 2.5× faster

Checklist

  • Added / updated tests under tests/pos/ or tests/warn/
  • Docs updated if the change affects user-visible behavior
  • Update CHANGELOG.md
  • A JIP is required for language change
  • All commits are signed off (why?)
How to sign off commits

Use git commit -s to add the Signed-off-by line automatically:

To add a sign-off to the last commit retroactively:

git commit --amend -s --no-edit

To add sign-off to the last 3 commits:

git rebase --signoff HEAD~3

Security impact

No

Compatibility impact

No

  • Source compatibility
    • syntax parsing
    • type checking
  • SAST compatibility
    • forward compatibility: new libraries can be used by old compiler
    • backward comopatibility: old libraries can be used by new compiler
  • Standard Library compatibility:
    • forward compatibility: new code can work with old stdlib
    • backward compatibility: old code work with the new stdlib
  • Runtime Library compatibility:
    • forward compatibility: new code can work with old runtime
    • backward compatibility: old code work with the new runtime
  • Build tool
    • Build spec compatibility: old projects continue to build
    • Joy package compatibility: old .joy can be consumed by new build tool

Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
@liufengyun
liufengyun requested review from everdance and a balanced review from Copilot October 18, 2026 20:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@liufengyun
liufengyun merged commit 3ad0c40 into main Oct 19, 2026
1 check passed
@liufengyun
liufengyun deleted the improve-list-join branch October 19, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants