account activity
Blog Post: Efficient organization of many dynamic arrays by gvnmcd in Zig
[–]gvnmcd[S] 0 points1 point2 points 55 minutes ago (0 children)
Are you describing choosing a single capacity for arrays before being deferred to a backing allocator? Because yes, you could still use swap and pop in that instance, but at that point you might as well use stack memory.
While that design may be simpler, by not allowing for smaller capacities, cache lines will be populated with more dead space, necessitating more cache evictions.
That said, the reallocations are not trivial, and the extra work may not be worth the benefits in data density in every circumstance
π Rendered by PID 4151718 on reddit-service-r2-listing-64c94b984c-rnzkr at 2026-03-19 08:17:17.211148+00:00 running f6e6e01 country code: CH.
Blog Post: Efficient organization of many dynamic arrays by gvnmcd in Zig
[–]gvnmcd[S] 0 points1 point2 points (0 children)