Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

When a {{Delay}} has been realized, {{f}} is set to {{nil}}. We can avoid {{truth_}} and {{not}} calls and directly compare with {{nil}} for a minor perf boost.

In {{script/noderepljs}}, this leads to these

(simple-benchmark [x (delay 1)] @x 1e9) (simple-benchmark [x (delay 1)] (realized? x) 1e9) (simple-benchmark [x (doto (delay 1) deref)] (realized? x) 1e9)

speeding up by 6%, 11% and 9%, respectively.

4 Answers

0 votes
by

Comment made by: mfikes

Under {{:advanced}} across all engines, the 3 benchmarks in the ticket description produce these speedup numbers:

`
  V8: 1.18, 1.15, 1.09
SpiderMonkey: 1.08, 1.04, 1.19
JavaScriptCore: 1.70, 0.86, 0.93

   Nashorn: 1.05, 1.15, 1.14
ChakraCore: 1.21, 0.52, 0.81

`

0 votes
by

Comment made by: mfikes

CLJS-1975.patch no longer applies

0 votes
by

Comment made by: mfikes

CLJS-1975-2.patch rebaselines and passes CI.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-1975 (reported by mfikes)
...