3 ms·
I hardly consider four bytes to track the length of a string "waste". I also don't really know why you assume that "sane" means "doesn't let you manage memory
by nerdponx 5y ago
I hardly consider four bytes to track the length of a string "waste".
I also don't really know why you assume that "sane" means "doesn't let you manage memory effectively".
That said, how many applications really are bottlenecked by string processing in the first place? I don't care if processing Unicode graphemes is slow, as long as it's correct and doesn't mangle users' names.
- novok 5y agoHe is probably thinking about the context of the 1980s, when a large amount of 3 byte waste (the 1 byte null char is a form of 'waste' itself) might have been a problem back then.
- jstimpfle 5y agoPacked structs with char fields of 8 bytes or so are still common.
- jstimpfle 5y agoWell I for one optimized an authorization module of an enterprise application written in Delphi by getting rid of standard library strings. Speedups where 100x-1000x, accelerating application startup time from minutes to maybe 3 seconds.