Skip to content

Perf/dlmalloc guest allocator - #869

Open
jotabulacios wants to merge 5 commits into
mainfrom
perf/dlmalloc-guest-allocator
Open

Perf/dlmalloc guest allocator#869
jotabulacios wants to merge 5 commits into
mainfrom
perf/dlmalloc-guest-allocator

Conversation

@jotabulacios

@jotabulacios jotabulacios commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

The guest allocator moves from embedded-alloc's TLSF heap to dlmalloc, with TLSF kept one
flag away (tlsf-alloc) for fallback. dlmalloc sits on a bump provider that hands it
page-aligned chunks of the guest heap, so it still reuses freed memory — no OOM — while
each alloc and free costs fewer guest instructions than TLSF.

Isolated A/B on the same tree, only the feature differs: guest cycles drop 11.2% on a
10-transfer ethrex block (1,702,365 → 1,511,225) and 13.1% on a 20-transfer one
(3,915,738 → 3,404,649). In the guest profile the allocator goes from 24.4% of cycles to
9.5%.

@diegokingston

Copy link
Copy Markdown
Collaborator

/bench

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Benchmark — ethrex 20 transfers (median of 3)

Table parallelism: auto (cores / 3)

Metric main PR Δ
Peak heap 51123 MB 49371 MB -1752 MB (-3.4%) ⚪
Prove time 25.974s 25.617s -0.357s (-1.4%) ⚪

✅ No significant change.

🔬 Looks like a small speedup (-1.4%) — below what 3 runs can confirm. Comment /bench-abba to run the drift-free ABBA tiebreaker (paired-t CI + exact Wilcoxon). Note: it occupies the bench server for ~30–40 min.
Optional pair count: /bench-abba 32 (20 resolves ~1%, 32 for ~0.6%).

✅ Low variance (time: 2.4%, heap: 2.1%)

Commit: 79e5437 · Baseline: cached · Runner: self-hosted bench

@diegokingston

Copy link
Copy Markdown
Collaborator

/bench

@jotabulacios
jotabulacios marked this pull request as ready for review July 29, 2026 13:51
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.

2 participants