6 ms·
> https://youtu.be/ncHmEUmJZf4?t=2220 https://youtu.be/ncHmEUmJZf4?t=2220 Some good points, but also "calling find with C strings is slow", you are using C str
by josefx 5y ago
> https://youtu.be/ncHmEUmJZf4?t=2220 https://youtu.be/ncHmEUmJZf4?t=2220
Some good points, but also "calling find with C strings is slow", you are using C strings, don't expect speed from code worshiping strlen of all things. Also the issue with integer hash being its identity? That is the case for every language I checked (Python, Java, C#).
- jcelerier 5y agoI mean, if Python, Java or C# were good enough for me as a C++ user, I'd use them. The mindset behind C++ is not a relative "thing must be good enough", but an absolute "there must not be something better possible". Of course, this is often not realized in practice, but it's the goal.
- josefx 5y ago> "there must not be something better possible" It maps all integer values to distinct hashes which seems rather ideal, what it doesn't give you is perfect performance in an artificial benchmark written to exploit this implementation.
- jcelerier 5y agoTangent, but I remember reading not too long ago that there were some cases where perfect hashes weren't optimal, but can't remember where..