Arc Forumnew | comments | leaders | submitlogin
1 point by reitzensteinm 6117 days ago | link | parent

I think that's an excellent idea.

But for particularly performance intensive situations, it would be nice to have a function that creates a hash table that's internally already an n element array.

There are probably only a few cases where this would actually be necessary (and it should only ever be done after profiling), but when you run into one of those cases, you're in deep trouble if there's no way around it.

An example would be if you'd like to write a bucket system for a 2D or 3D set of objects, and have the system still functional. Reusing the buckets between calls would turn everything into an array quickly, but the thought of xyz hash maps realizing they should be arrays at runtime is a bit scary. Allocating arrays directly, on the other hand, should still be more than fast enough for use in real time applications.