5 ms·
IMO all arrays should be double-ended.
by wfunction 12y ago
IMO all arrays should be double-ended.
- aidos 12y agoBut wouldn't that slow down all arrays in the general case....?
- wfunction 12y agoMaybe by like 2 CPU instructions? Javascript isn't C; that level of performance is noise in JS...
- pcwalton 12y agoYou'd be surprised. Adding 2 instructions to every array operation would probably kill your engine's relative SunSpider or V8 score. JS performance is extremely competitive.
- wfunction 12y agoSure, I can believe it'd affect the score, but I can't believe anyone would actually care about it. It's not like Javascript was designed for performance to begin with.
- nightcracker 12y agoI'm working on a data structure that is not slower: https://github.com/orlp/devector https://github.com/orlp/devector