'use strict';
const ITER = 1e7;
let t = performance.now();
// Use of "let" in for loop.
for (let i = 0; i < ITER; i++);
t = performance.now() - t;
print(t);
t = performance.now();
// Use of "var" in for loop.
for (var i = 0; i < ITER; i++);
t = performance.now() - t;
print(t);
// Output:
// 486.324
// 28.25
{
let i = 0;
for (; i < ITER; i++);
}
--
You received this message because you are subscribed to the Google Groups "Strengthen JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strengthen-j...@googlegroups.com.
To post to this group, send email to streng...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/strengthen-js/80ab62ae-9116-4c19-a16b-6c6540bfae85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Trevor, I am working as we speak to make this faster.The dirty secret is that in current V8 all 'let' and 'const' variables are actually context-allocated, not stack-allocated.This will be fixed very soon though.
The dirty secret is that in current V8 all 'let' and 'const' variables are actually context-allocated, not stack-allocated.
Thanks Trevor, I am working as we speak to make this faster.The dirty secret is that in current V8 all 'let' and 'const' variables are actually context-allocated, not stack-allocated.This will be fixed very soon though.
--
You received this message because you are subscribed to the Google Groups "Strengthen JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strengthen-j...@googlegroups.com.
To post to this group, send email to streng...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/strengthen-js/624ebb65-980e-4ff4-9df3-ae03d1ef5988%40googlegroups.com.