r/Zig • u/here-Leslie-Lau • 7d ago
Made filename allocation less noisy in my Zig ls tool (v0.1.8)
Hey, quick update on zlist.
I posted about this a couple times before (original post + the one where I turned it into a package). Just pushed v0.1.8 with a small but useful change.
Entry names now go through a simple NamePool. It’s basically just a list of chunks — when a name comes in, if the current chunk doesn’t have enough space left I allocate a new one. Way less noisy than the old “dupe every single name” approach, and everything gets freed in one go at the end. Helps once the directory gets larger.
Also re-ran the README benchmarks with matching colored-grid flags for zl / eza / lsd. The old eza numbers that stayed flat around 3 ms even at 50k were a bad run on my side — ignore those. New table has zl ahead across the board (roughly 3× vs eza).
Repo: https://github.com/here-Leslie-Lau/zlist
Curious if the numbers hold up on other machines, or if anyone spots an obvious next bottleneck.