Skip to content

Minimize array allocations#437

Merged
blakeembrey merged 1 commit intomasterfrom
be/min-allocations
Apr 1, 2026
Merged

Minimize array allocations#437
blakeembrey merged 1 commit intomasterfrom
be/min-allocations

Conversation

@blakeembrey
Copy link
Copy Markdown
Member

Changing a couple of code paths to remove array allocations entirely without any changes to code behavior.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (57247e6) to head (d679ff6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #437   +/-   ##
=======================================
  Coverage   99.74%   99.75%           
=======================================
  Files           1        1           
  Lines         398      400    +2     
  Branches      158      161    +3     
=======================================
+ Hits          397      399    +2     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/index.spec.ts
const stack = (error as Error).stack
?.split("\n")
.slice(0, 5)
.slice(0, 6)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Introducing process for handling the recursive array introduces an extra stack. In a new major we should drop the ability to have infinite recursion and we won't need this function anymore. But for now it avoids a new array getting created.

@blakeembrey blakeembrey merged commit 937c02d into master Apr 1, 2026
8 checks passed
@blakeembrey blakeembrey deleted the be/min-allocations branch April 1, 2026 21:13
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.

1 participant