271 posts
  • 5 Years of Membership
  • Author Level 4
  • Collector Level 1
  • Exclusive Author
+4 more
07happydays
says

Using short variable names is 20% faster than using long variable names. This is tested.

2054 posts
  • Affiliate Level 3
  • Author Level 11
  • Collector Level 2
  • Elite Author
+11 more
bitfade
says

where ?

3757 posts
  • Elite Author
  • Spain
  • Author Level 8
  • Featured Author
+11 more
pezflash
says
Using short variable names is 20% faster than using long variable names. This is tested.

Obviously less bits take less time for the processor. But man, i think we are talking around 5 milliseconds difference in a whole site with, let’s say, 50 different variables.

A bad exported jpg image takes thousands percent more importance, if we talk about optimizing.

I think names of variables should give a quick and useful reference for the developer. That’s all. Then you can name them with all the alphabet, if you find it necessary.

4140 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 4
  • Brazil
+5 more
tsafi
says

Well in a logic way the Pez` (less bits take less time for the processor) is right less syntax var is better ,but I don’t think any one or you will notice this unless you have some big project you are working on and you are trying to save juice speed all you can but again its really negligible and you shouldn’t worry about it at all ,but i have a habit to make it very short on the var

271 posts
  • 5 Years of Membership
  • Author Level 4
  • Collector Level 1
  • Exclusive Author
+4 more
07happydays
says
where ?

Well I read this some time ago here: http://www.lostinactionscript.com/blog/index.php/talks/ slide 91.

34 posts
  • 5 Years of Membership
  • Affiliate Level 3
  • Author Level 5
  • Collector Level 1
+3 more
majakovskij
says

Just to clarify…

As far as I know, this tests are usually conducted using simple statement in huge iterations.

So 20% is relative to 5 million of iteration of read/write a variable and nothing else.

In a real project this gain may become 0.1%.

BTW very long variable name may be hard to read than the shorter one.

6231 posts
  • Exclusive Author
  • Elite Author
  • Author Level 8
  • 7 Years of Membership
+13 more
VF
says

^ exactly.

20%, 5 times faster, 100 times faster blah blah are the results of extreme torture tests. As long as the final project doesn’t touches reasonable CPU , it is unnecessary to put hard rules on naming conventions etc. Optimization needs varies widely depending on complexity of project (and end user in case you sell the source code).

Also I am sure that long variable names are very hard to handle while coding. Better way is coding with short names (single or double letter) while working and find – replace with legible words after completion if needed. The variables having more than 2 words will definitely kill our concentration on coding / logic.

132 posts
  • Affiliate Level 2
  • Author Level 6
  • Beta Tester
  • Collector Level 2
+3 more
baklach
says

http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/#hide This was nice, and i think it answers the question! and it was in 2006 :D

In comments: Someone did something like that in AS2 , read comments…

by
by
by
by
by
by