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.

my fiddle demonstrate

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

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -