4 ms·
No. http://stackoverflow.com/questions/7299010/why-is-string-concatenation-faster-than-array-join http://stackoverflow.com/questions/7299010/why-is-string-con.
by smilekzs 12y ago
No.
http://stackoverflow.com/questions/7299010/why-is-string-concatenation-faster-than-array-join http://stackoverflow.com/questions/7299010/why-is-string-con...
- peterfirefly 12y agoNot all Javascript implementations use ropes internally.
- jws 12y agoYes. I'm not using the V8 engine. Tiny embedded engine, no super powers other than EC5 correct, small size, and reasonable performance. Of course V8 and its multimillion dollar development cost rivals probably only have this superpower because programers kept writing quadratic code.
- pcwalton 12y ago> Of course V8 and its multimillion dollar development cost rivals probably only have this superpower because programers kept writing quadratic code. …and because SunSpider does it. https://github.com/WebKit/webkit/blob/master/PerformanceTests/SunSpider/tests/sunspider-1.0.2/string-base64.js https://github.com/WebKit/webkit/blob/master/PerformanceTest...
- smilekzs 12y ago... which is __the__ problem I was referring to, because these two implementations have essentially become black boxes with different performance on differnt runtimes. Should all library writers detect runtime and choose the optimal one? I don't think so. They're far more likely to simply write `a+=b`, which is NOT quadratic without any knowledge of the underlying impl.