Skip to content

[Autoloop: tsb-perf-evolve] - #245

Merged
mrjf merged 1 commit into
mainfrom
autoloop/tsb-perf-evolve
Apr 29, 2026
Merged

[Autoloop: tsb-perf-evolve]#245
mrjf merged 1 commit into
mainfrom
autoloop/tsb-perf-evolve

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Goal

Minimize fitness = tsb_mean_ms / pandas_mean_ms for Series.sortValues at n=100k. Lower is better; < 1.0 means tsb beats pandas.

Program Issue: #189
Current best metric: 27.999


Iteration 27: Make finBuf/nanBuf/fvals module-level

Eliminate 1.6MB TypedArray allocation per sortValues call:

  • finBuf (400KB), nanBuf (400KB), fvals (800KB) → module-level, grown lazily
  • _fvalsU32 → persistent Uint32Array view of _fvals.buffer, updated on reallocation
  • At n=100k with 50 measured iterations: removes ~80MB of GC pressure per benchmark run

The radix sort ping-pong buffers were already module-level; this extends the same pattern to the pre-partition buffers.

Run: https://github.com/githubnext/tsessebe/actions/runs/25137904374


🤖 This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.

Generated by Autoloop · ● 2.7M ·

Eliminate 1.6MB TypedArray allocation per sortValues call at n=100k.
Per-call: finBuf(400KB) + nanBuf(400KB) + fvals(800KB) = 1.6MB × 50 iters = 80MB GC.
Now lazily grown module-level buffers, like the existing radix ping-pong buffers.
Also reuse _fvalsU32 as a persistent Uint32Array view of _fvals.buffer.

Run: https://github.com/githubnext/tsessebe/actions/runs/25137904374

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mrjf
mrjf marked this pull request as ready for review April 29, 2026 23:03
@mrjf
mrjf merged commit 2a497b1 into main Apr 29, 2026
12 checks passed
@mrjf
mrjf deleted the autoloop/tsb-perf-evolve branch April 29, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant