Skip to content

add mimalloc#212

Draft
Shourya742 wants to merge 2 commits into
stratum-mining:mainfrom
Shourya742:2026-01-24-add-mimalloc
Draft

add mimalloc#212
Shourya742 wants to merge 2 commits into
stratum-mining:mainfrom
Shourya742:2026-01-24-add-mimalloc

Conversation

@Shourya742

Copy link
Copy Markdown
Member

This PR switches the binaries to use mimalloc instead of the default glibc allocator, which can exhibit higher fragmentation and contention under our workload.

@Shourya742 Shourya742 force-pushed the 2026-01-24-add-mimalloc branch from 300f7ff to 485b030 Compare January 24, 2026 08:01
@GitGab19

GitGab19 commented Feb 3, 2026

Copy link
Copy Markdown
Member

Why do we need this change?

Do we have some data which demonstrates how this change is improving performances of our apps?

@Shourya742

Shourya742 commented Feb 3, 2026

Copy link
Copy Markdown
Member Author

Why do we need this change?

Do we have some data which demonstrates how this change is improving performances of our apps?

Yes, it’s a memory allocator that’s better suited to our use case: long-running processes with frequent allocations, high concurrency, and a need for consistent latency. The default global allocator isn’t ideal here, as it tends to increase fragmentation and introduce global locking during allocations. I will run benchmarks and share the results here.

@Shourya742 Shourya742 force-pushed the 2026-01-24-add-mimalloc branch from e2cd179 to fb6d404 Compare February 17, 2026 12:32
@Shourya742

Copy link
Copy Markdown
Member Author

Global Allocator:
Screenshot from 2026-02-17 19-23-20

mimalloc:
Screenshot from 2026-02-17 18-46-18

Mimalloc does make us faster.

@GitGab19

Copy link
Copy Markdown
Member

Should we close this @Shourya742 ?

Or at least putting it in draft?

@Shourya742

Copy link
Copy Markdown
Member Author

I don't remember now, why we stalled this PR?

@GitGab19

Copy link
Copy Markdown
Member

I don't remember exactly now, but it was not something we ever planned?

Maybe it makes sense to run again the analysis after the improvements on hotpath described here?

@Shourya742

Copy link
Copy Markdown
Member Author

That might be the case, once the hotpath thingy is in. I will give the numbers another shot.

@GitGab19 GitGab19 marked this pull request as draft June 10, 2026 10:08
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