-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
investigate SmpAllocator performance with respect to other popular allocators #12484
Copy link
Copy link
Open
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.optimizationstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.optimizationstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Ditch LLVM
With #22808 set to auto-merge, I am editing this issue to clarify the issue closure requirements, without changing them.
std.heap.SmpAllocatorfills the niche of-OReleaseFast -fno-single-threaded.Issue Close Requirements:
"faster" is vague, and allocators are typically not strictly better or strictly worse than each other. For the purposes of this issue it means the allocator has been tested in various different real world programs and had performance and peak RSS measured, and found to be in the same, or better "sweet spot".
If
std.heap.SmpAllocatorcannot be adapted to be the winner, or should remain in its own sweet spot while another sweet spot is found to exist, then a new allocator implementation should be created.A box can still be ticked if due diligence has been done and neither allocator is strictly better than the other, and the set of tradeoffs are judged to be desirable.
Originally, this issue specified that
std.heap.GeneralPurposeAllocatorshould choose this when optimization mode is ReleaseFast, however that has been renamed tostd.heap.DebugAllocator. I will open a new issue, or perhaps simply a PR that introducesstd.heap.DefaultAllocatorthat provides reasonable conditional compilation logic for choosing an allocator in an application's main function.