re: Javascript Array.push is 945x faster than Array.concat 🤯🤔 VIEW POST


I'm really curious about your use case now. DO the arrays even need to be combined? Would it be possible to have an array of arrays instead, slightly modifying the search algorithm? This could mean no longer needing to modify or duplicate any content at all, making things even faster.


That did occur to me when I was refactoring our code to fix this problem, it is possible in my use case, that hurts my code readability and the performance improvement from refactoring .concat to .push was good enough for me to be satisfied.

code of conduct - report abuse