3 ms·
String-keyed hash maps are really common, and the keys tend to be ASCII. This would increase their size by a factor of 4, resulting in substantially increased m
by mikeash 7y ago
String-keyed hash maps are really common, and the keys tend to be ASCII. This would increase their size by a factor of 4, resulting in substantially increased memory usage and decreased performance.
- WhitneyLand 7y agoCertainly, but I’m not sure myself, can you think of any scenarios that are common where the difference would be noticeable or significant?
- mikeash 7y agoBoot any modern OS and you’ll have megabytes if not tens of megabytes of these strings, and spend a small but significant amount of CPU time looking them up. This may not matter on your Ryzen desktop with 97 cores and 318GB of RAM, but it’s substantial on a smartphone.
- WhitneyLand 7y agoWell, that seems to be an unfounded assumption that I'm considering only powerful machines, especially since possible challenges on small devices were mentioned in the OP. In fact, I done a fair amount of ARM coding so I understand what you are trying to say. Nevertheless, your comment seems to point out smartphones may be less powerful, but sheds no light on what the delta might be for boot performance or how you can be confident it's say, more than a few hundred milliseconds. Maybe it is, I haven't isolated and investigated that single difference enough to form a reasonable guess. Have you?
- ben509 7y agoAny dynamic language, as all the symbols are strings.