694 B
694 B
speci.js - specialization benchmark test
Tests two-property objects with {x, y} or {y, x} and access in a tight loop When the array contains consistent elements it optimizes well, but slows down as you add variants, and slows down A LOT if you add other random properties
% make test
node speci.js x-first
** x-first
run 1
189 ms
run 2
293 ms
run 3
178 ms
node speci.js y-first
** y-first
run 1
196 ms
run 2
175 ms
run 3
174 ms
node speci.js mixed
** mixed
run 1
732 ms
run 2
716 ms
run 3
912 ms
node speci.js rand-suffix
** rand-suffix
run 1
15596 ms
run 2
15636 ms
run 3
15501 ms
node speci.js rand-prefix
** rand-prefix
run 1
18896 ms
run 2
18883 ms
run 3
18784 ms