2 ms·
This is one of the things that every runtime seems to learn independently, no matter how many times it is learned. I've lost track of the number of languages/ru
by jerf 5y ago
This is one of the things that every runtime seems to learn independently, no matter how many times it is learned. I've lost track of the number of languages/runtimes/VMs that started by "cleverly" sharing string memory when you take slices, only to turn the slices back into copies when after a few years a bunch of programs start failing because of tiny little strings holding on to megabyte upon megabyte of underlying string.
Another example of how rough this can be is any program speaking over a network because it's really easy to end up with every network packet you've ever gotten (more or less) hanging around in memory because you've got this or that tiny bit of some string that was constructed to represent some chunk of the stream.
Surprised to see it in a javascript context, though. I'd have thought they'd have long since passed the point where they found out they have to take copies.
- deleted 5y ago[deleted]