News for hackers. Stuff that matters.
Re:Node occasionally gives multiple files/folders the same i... by deckar01 on Tuesday April 18, 2017 @11:14PM (#14145185)
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

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

There are no comments on this comment yet.