Reducing memory overhead with StringTape
PerformanceComments
If the use case requires frequent updates to individual strings, wouldn't the cost of rebuilding the contiguous buffer outweigh the memory savings? One might wonder if the CPU overhead for writes negates the RAM benefit.
Does the packing strategy implement a compaction phase? I am curious how it handles the holes left by deleted strings.
Wait, is that 7x figure based on really tiny strings... like just a few characters? I wonder if the benefit drops off once the actual text starts outweighing the pointer size...
rust string headers are 24 bytes. for 4 byte strings, that is a 6x overhead before the heap allocation.
This isn't just a memory trick. It is a play for the Arrow ecosystem. If everything is moving toward columnar storage, the standard heap is basically legacy tech.
We saw this exact logic with the rise of string interning crates years ago. The trade-off is always the same: you trade mutation flexibility for a smaller footprint.