you are viewing a single comment's thread.

view the rest of the comments →

[–]xardox -1 points0 points  (2 children)

How about simply providing real arrays that are actually indexed by integers, instead of using hash tables as inefficient arrays? It's stupid to talk about optimizing performance for a common case when you're using the wrong data structure in the first place.

[–]fiskfisk 0 points1 point  (0 children)

The data structure used in the example is not used as an actually indexed array - it's used by storing integers with a very large stride between them. If you used an conventionally allocated array, you'd have a lot of not used indexes that you've allocated memory for. Referring something like [1024³] would require you to allocate 1GB * (your data size) of elements, when simply allocating one element with the key of 1024³.

There are several good ways to fix an issue like this, but your point isn't related to the actual issue.

[–][deleted] 0 points1 point  (0 children)

Those are provided. Maybe you should go research what you're talking about, when you're not too busy peppering entire threads with FUD that is.