speci/readme.md

63 lines
694 B
Markdown
Raw Permalink Normal View History

2023-09-04 07:53:39 -07:00
# speci.js - specialization benchmark test
Tests two-property objects with {x, y} or {y, x} and access in a tight loop
2023-09-04 10:27:40 -07:00
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
2023-09-04 07:53:39 -07:00
```
2023-09-04 10:23:59 -07:00
% make test
node speci.js x-first
** x-first
2023-09-04 07:53:39 -07:00
run 1
2023-09-04 10:23:59 -07:00
189 ms
2023-09-04 07:53:39 -07:00
run 2
2023-09-04 10:23:59 -07:00
293 ms
2023-09-04 07:53:39 -07:00
run 3
2023-09-04 10:23:59 -07:00
178 ms
2023-09-04 07:53:39 -07:00
2023-09-04 10:23:59 -07:00
node speci.js y-first
** y-first
2023-09-04 07:53:39 -07:00
run 1
2023-09-04 10:23:59 -07:00
196 ms
2023-09-04 07:53:39 -07:00
run 2
2023-09-04 10:23:59 -07:00
175 ms
2023-09-04 07:53:39 -07:00
run 3
2023-09-04 10:23:59 -07:00
174 ms
2023-09-04 07:53:39 -07:00
2023-09-04 10:23:59 -07:00
node speci.js mixed
2023-09-04 07:53:39 -07:00
** mixed
run 1
2023-09-04 10:23:59 -07:00
732 ms
2023-09-04 07:53:39 -07:00
run 2
2023-09-04 10:23:59 -07:00
716 ms
2023-09-04 07:53:39 -07:00
run 3
2023-09-04 10:23:59 -07:00
912 ms
2023-09-04 07:53:39 -07:00
2023-09-04 10:23:59 -07:00
node speci.js rand-suffix
** rand-suffix
2023-09-04 07:53:39 -07:00
run 1
2023-09-04 10:23:59 -07:00
15596 ms
2023-09-04 07:53:39 -07:00
run 2
2023-09-04 10:23:59 -07:00
15636 ms
2023-09-04 07:53:39 -07:00
run 3
2023-09-04 10:23:59 -07:00
15501 ms
node speci.js rand-prefix
** rand-prefix
run 1
18896 ms
run 2
18883 ms
run 3
18784 ms
2023-09-04 07:53:39 -07:00
```