Why is the upper expression roughly twice as fast in chrome?
(time (dotimes [i 10000000] ((fn [_]) :foo)))
(time (let [x (fn [_])] (dotimes [i 10000000] (x :foo))))
I ran this in http://app.klipse.tech/don't microbenchmark javascript jit compilers
I have very little knowledge of compiler optimizations, but maybe because in the first expression, the closure of the immediately-invoked function is the same as the caller, so the JS compiler knows it can elide code which would modify the stack before entering the function
could be!