Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #28585

Re: Performance question

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Performance question
Date 2015-08-30 22:16 +0200
Organization PointedEars Software (PES)
Message-ID <6778316.kWqCXO56M2@PointedEars.de> (permalink)
References <dje4uadokf3hpfi2e702t404088avf2d49@4ax.com> <performance-20150830002413@ram.dialup.fu-berlin.de>

Show all headers | View raw


Stefan Ram wrote:

> "Joey@still_Learning.invalid" <Joey@still_Learning.invalid> writes:
>>                                      If I declare a global variable
>>as 'var xxx = document.getElementById('id'),' and use it throughout
>>the script as 'xxx.value or xxx.checked,' does this improve
>>performance?
> 
>   One does indeed expect such an improvement, but the
>   best thing is to measure it under different browsers.

There is no good reason to believe that omitting a function call in favor of 
a variable access would not improve performance.  It is unnecessary to 
measure this.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Performance question "Joey@still_Learning.invalid" <Joey@still_Learning.invalid> - 2015-08-29 16:11 -0700
  Re: Performance question "Joey@still_Learning.invalid" <Joey@still_Learning.invalid> - 2015-08-30 09:50 -0700
  Re: Performance question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-08-30 22:16 +0200
    Re: Performance question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-08-30 22:21 +0200

csiph-web