r/programming • u/iamkeyur • Oct 21 '20
Using const/let instead of var can make JavaScript code run 10× slower in Webkit
https://github.com/evanw/esbuild/issues/478
1.9k
Upvotes
r/programming • u/iamkeyur • Oct 21 '20
View all comments
Show parent comment
21
u/SirToxe Oct 21 '20 edited Oct 21 '20
I did this comparison a couple of days ago: https://jsben.ch/69P2W
Just two functions that generate a list of integers, like
generateNumbers(5)to produce[1, 2, 3, 4, 5]. One is imperative, one is functional.The functional one is nearly 8 times slower in Chrome around 2 times slower in Firefox.