Preferences


I've always found it somewhat confusing how common operations like this with identical behavior but differing syntax can have such drastic differences in speed. Another example would be `for (let i in array) { array[i]...` versus `array.forEach(...`.

For highly optimized engines like V8 and SpiderMonkey, it seems like recognizing these cases and automatically substituting in the faster behavior would be pretty low hanging fruit that could have a significant impact on existing scripts' performance.

Maybe there's some underlying reason to do with how these engines work internally that prevents such optimizations from easily being performed though.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal