4 ms·
I'm not sure an array matches the use case of an inode number. The only practical uses are comparison and indexing. It is more natural to use strings to index h
by deckar01 9y ago
I'm not sure an array matches the use case of an inode number. The only practical uses are comparison and indexing. It is more natural to use strings to index hashes than a typed arrays.
Some were concerned with the performance of comparing strings, because a hex encoded string has 16 values to compare instead of 2. One might think this results in a 700% slowdown, but assuming that the operation short circuits, it is theoretically a 6.67% slowdown [0].
[0]: http://wolfr.am/l1JVtEi7 http://wolfr.am/l1JVtEi7
Edit: Benchmarks [1] indicate that string comparisons are significantly faster. It is not surprising that string comparison has been heavily optimized.
[1]: https://jsperf.com/64bit-comparison https://jsperf.com/64bit-comparison