From 7dd97f6543fe53e92c5b671c49f3f021d75ff602 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 4 Sep 2023 07:53:39 -0700 Subject: [PATCH] readme --- readme.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..81dd0d4 --- /dev/null +++ b/readme.md @@ -0,0 +1,52 @@ +# 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 the first +run is much slower on a randomly mixed array. + +Subsequent runs come up much faster as the higher-tier compilers in V8 can +handle a couple of different variants -- but this might not be true of all +possibilities. 256 randomized variants is linearly slower. + +``` + % node speci.js +** x_first +run 1 +72 ms + +run 2 +15 ms + +run 3 +22 ms + +** y_first +run 1 +73 ms + +run 2 +23 ms + +run 3 +20 ms + +** mixed +run 1 +2766 ms + +run 2 +52 ms + +run 3 +53 ms + +** randomized +run 1 +464 ms + +run 2 +445 ms + +run 3 +445 ms +```