3 ms·
interesting idea, although not obvious this would have the intended affect. E.g., consider a string search across 10 different string objects (thus 10 differen
by mikeeeek 7y ago
interesting idea, although not obvious this would have the intended affect. E.g., consider a string search across 10 different string objects (thus 10 different backing arrays), vs a search across a single array. Much more likely for increase in cache misses when you hit 10 different arrays at potentially 10 different locations in memory.
Also, this implies some copy-on-write semantics. At first thought, this makes code significantly more complex.
- jbverschoor 7y agoYou can always make the string concrete for certain operations. Most of the string building is usually just concatenation