Re: Organizing data for readability and efficiency




If you are considering making the choice between arrays and hashes based on
the performance of single look-ups into each (rather than by whether the
nature of your data best fits an array or best fits a hash), then I say you
are engaging in micro-optimization.  Perhaps this is the nub of your
question, so let me repeat.  The difference between array access and hash
access is small enough that if you are concerned about it, only actual
tests on actual data will be satifactory.

Let me try again, I'm not concerned about the performance of single lookups, I'm concerned with at least hundreds of thousands. I was hoping for a simple answer but if that's not going to happen I also agree with you that the real answer is to measure it and I guess that's what I'll end up doing.
-mark
.




Relevant Pages

  • Re: Organizing data for readability and efficiency
    ... >> nature of your data best fits an array or best fits a hash), ... The difference between array access and hash ...
    (comp.lang.perl.misc)
  • Re: Organizing data for readability and efficiency
    ... >> whether the nature of your data best fits an array or best fits a ... >> array access and hash access is small enough that if you are concerned ... you do single lookups a hundred thousand times, ...
    (comp.lang.perl.misc)
  • Duck Typed Concepts for Ruby (was Re: A use case for an ordered hash)
    ... An Sequencable mixin can be defined that implements all sorts of operations such as append, concat, splice, sort, etc. ... extending an instance of Array with Sorted if the array is known to be sorted. ... Now returning to the thread at hand we can see that the difference between the associative array and hash hierarchies is that the hash hierarchy depends upon Hashable keys. ...
    (comp.lang.ruby)
  • Re: Suggestions for double-hashing scheme
    ... >> The items that are being moved are the items in the hash table itself, ... >> which are of fixed size (they are in an array, ... > typedef struct { ... One "uchar" aka 'unsigned char' is plenty to hold a probe ...
    (comp.programming)
  • [SUMMARY] Index and Query (#54)
    ... This was a fun quiz for me because I really don't know anything about indexing ... We see in initializethat the index is just a Hash. ... an Array of symbolic document names where the word can be found ). ...
    (comp.lang.ruby)