Aaron Suen a6308d8378 Don't pre-initialize stone strata arrays
The original theory was that preallocating the array forced lua
to use the "array part" of a table instead of the "hash part",
which should be faster since lookups are a simple linear offset
calculation and not a hash with collision check.

It turns out, however, that in empirical testing, whether the
array-preallocated or the naive-allocated version is faster depends
on circumstances, such as how sparse the array is, how uniform
access is, or how much other load the system is under.  This seems
to suggest that arrays are more computationally-efficient but less
cache-efficient, so cache evictions caused by other concurrent
processes may slow this method down significantly.

Worst-case performance will be the most noticeable here, since a
system that's heavily loaded would have the most need for speed
in the first place, so it's probably better generally to use the
naive allocation.

In all, the naive allocation method also seemed to be the least
sensitive to external factors.  In addition to the array method,
attempts to pre-compile the dynamic checks into a binary tree of
if/then statements (which could be JITted and optimized) failed
as well.
2021-04-07 07:44:13 -04:00
..
2021-04-06 22:24:05 -04:00
2021-03-25 18:28:54 -04:00
2021-04-06 22:24:05 -04:00
2021-04-06 22:24:05 -04:00
2021-04-03 19:21:09 -04:00
2021-03-08 21:43:47 -05:00
2021-03-15 00:11:05 -04:00
2021-04-02 22:35:45 -04:00
2021-03-24 09:36:04 -04:00
2021-03-18 09:49:34 -04:00
2021-03-09 08:16:23 -05:00
2021-03-09 08:33:58 -05:00