5 ms·
I didn't mention how I feel about hash tables (I'm not OP), but I think we feel the same? I definitely agree that arrays (potentially vector style growable arra
by Impossible 7y ago
I didn't mention how I feel about hash tables (I'm not OP), but I think we feel the same? I definitely agree that arrays (potentially vector style growable arrays) should be a programmer's go to data structure, both for simplicity and performance. For my use cases I'd probably swap array and hash table usage with OP (70% array and 30% hash) but really it's probably more like 90, 10. Computing hash functions and resolving collisions can be very fast with the right hash table implementation, but it's absolutely not free. There is a reason why Lua tables can implement array like access and memory usage, even if from a language standpoint a Lua table looks like a hash table with some fancy features.
- banachtarski 7y agoAh didn't realize you weren't OP. I think any programmer that operates in the realms of microseconds probably would understand the overhead of both the hash function overhead as well as the coherency issue. I'm not a lua programmer but I remember studying the LuaJIT source pretty extensively.