fracture91 / ignpp

Firefox and Chrome extension for boards.ign.com
http://vestitools.pbworks.com/
3 stars 2 forks source link

String builder pattern is irrelevant #287

Open fracture91 opened 11 years ago

fracture91 commented 11 years ago

I know there are some places in the code (usercolors) that build strings by pushing substrings into an array and then .joining the array. This "optimization" is irrelevant and was probably only ever useful for old IE versions. string.concat(blah) and the += operator are much faster.

http://jsperf.com/array-push-vs-unshift/22 https://pay.reddit.com/r/programming/comments/16e1kh/gmails_javascript_garbage_collection_hacks/c7vaa91