4 ms·
this smells like a js engine optimization. you wouldn't expect substantially different machine code to run for "Direct assignment" and "other". i wouldn't be
by kwamenum86 13y ago
this smells like a js engine optimization. you wouldn't expect substantially different machine code to run for "Direct assignment" and "other". i wouldn't be surprised if the loop is being unrolled or something.
- lttlrck 13y agoThey could all be reasonably unrolled, so it's probably something else. I expect the engine can more easily calculate the final required Array size and preallocate it upfront avoiding resize operation on each loop iteration. (which is anyway JS best practice when possible)