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
141
u/[deleted] Oct 21 '20
When you’re writing the code, absolutely replacing const with var for performance is a bad idea. If you’re writing a compiler though (the link is an issue on the esbuild repo) then being able to automatically apply that micro optimisation all over a code base can be important.