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


Groups > comp.lang.javascript > #28585

Re: Performance question

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Performance question
Date Sun, 30 Aug 2015 22:16:23 +0200
Organization PointedEars Software (PES)
Lines 20
Message-ID <6778316.kWqCXO56M2@PointedEars.de> (permalink)
References <dje4uadokf3hpfi2e702t404088avf2d49@4ax.com> <performance-20150830002413@ram.dialup.fu-berlin.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace solani.org 1440965994 30156 eJwFwQkBwDAIA0BLML5UDivEv4TehaXmLc9IDwZLOGpw1bIebF1q0qXAPgIwfn5bSz8+aDwU2hEg (30 Aug 2015 20:19:54 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Sun, 30 Aug 2015 20:19:54 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwFwYEBwDAEBMCVkMcbpyT2H6F3fkJjEuEBX18raxjxTKLA0X7XWKroS9+RzZVXlfxkRu4hm6cgX0Zy4wc2WxTA
Cancel-Lock sha1:6KuC9OQR/toSO8NhK8sN9wxfGSM=
X-NNTP-Posting-Host eJwFwYEBACAEBMCV9PExTsT+I3Rnm4t1lEa1scm4RJjgsstbFkReUzPqJRTscdX0g316hB8XGhDQ
Xref csiph.com comp.lang.javascript:28585

Show key headers only | 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