Timeline for What is the benefit of caching a hash value in a string object?
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 7, 2022 at 19:22 | comment | added | Kaz | I've not seen any improvement in the test suite run time, or recompilation of the language's compiler and library. A contrived benchmark which hashes the same string in a loop shows a big difference, of course. | |
Oct 7, 2022 at 19:19 | comment | added | Kaz | The context is that we take it for granted that the biggest, perhaps only consumer of hash values is the hash table implementation. Why is it worth doing? There is no benefit if the keys being looked up are strings arriving from the environment, being constructed into new string objects. | |
Oct 7, 2022 at 19:17 | comment | added | Kaz | Sorry, that is obvious and not what my question is about; I now regret having edited the remarks around hash tables from my question. | |
Oct 7, 2022 at 19:08 | history | answered | Philip Kendall | CC BY-SA 4.0 |