javascript - Variable name length vs performance -
how possible, huge difference in variable name length won't cause any performance loss in javascript?
it tooks same time declare var = 0;
takes declare var aaaaaaaaaaaaaaa = 0;
tooks same time execute computations them.
based on @cerbrus's comment:
it causes negligibly small performance difference in practise, when declaring variable. afterwards, gets specific address in memory, , referred address, not variable name, won't affect performance anymore.
however, talking scripting language used on web, shorter variable names can reduce filesize, , speed pageloads. 1 of features of js compilers, such google's.
Comments
Post a Comment