You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for creating GC-optimized maps via a makeMap function, similar to Go's built-in make function.
Background
When working with arena allocator in high-performance scenarios, maps remain a bottleneck as they are still subject to GC scanning even when other data structures are allocated in arena. This becomes particularly problematic in applications handling large amounts of data where GC pressure needs to be minimized.
Current Limitation
Currently, while nuke provides excellent support for arena allocation, maps cannot be allocated in arena memory. This means that even in code heavily optimized with arena allocations, maps still contribute to GC overhead.
Proposed Solution
Add a makeMap function that creates a map-like data structure optimized for minimal GC scanning. The implementation could:
Use contiguous memory blocks for storage
Avoid pointer types in the internal implementation
Support basic map operations while minimizing GC overhead
Potentially support type parameters for type safety
Example usage:
// Create a new GC-optimized mapm:= nuke.MakeMap[uint64, uint64](initialSize)
// Basic operationsm.Put(key, value)
val, exists:=m.Get(key)
m.Delete(key)
The text was updated successfully, but these errors were encountered:
Feature Request
Add support for creating GC-optimized maps via a
makeMap
function, similar to Go's built-inmake
function.Background
When working with arena allocator in high-performance scenarios, maps remain a bottleneck as they are still subject to GC scanning even when other data structures are allocated in arena. This becomes particularly problematic in applications handling large amounts of data where GC pressure needs to be minimized.
Current Limitation
Currently, while nuke provides excellent support for arena allocation, maps cannot be allocated in arena memory. This means that even in code heavily optimized with arena allocations, maps still contribute to GC overhead.
Proposed Solution
Add a
makeMap
function that creates a map-like data structure optimized for minimal GC scanning. The implementation could:Example usage:
The text was updated successfully, but these errors were encountered: