Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28580
| From | "Joey@still_Learning.invalid" <Joey@still_Learning.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Performance question |
| Date | 2015-08-29 16:11 -0700 |
| Message-ID | <dje4uadokf3hpfi2e702t404088avf2d49@4ax.com> (permalink) |
I'm attempting to optimize a lengthy ECMA script for speed. Please
pardon my ignorance...
I have multiple instances of document.getElementById('id').checked or
value.
Q1: When running the script, does it search through a table for the
address, or does it only do it once during compilation?
Q2. Moot if Q1 answer is 'only once.' 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?
Thanks in advance for helping and not beating me up.
--
Joey
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll 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