[Prototype-core] Re: Can prototype.js cache an elements?

2009-02-21 Thread kangax
On Feb 21, 10:55 am, sarapapa wrote: > Hi, kangax. > > > Element extension is very slow in JScript, so `$` is not slow due to > > `getElementById` but is slow due to `Element.extend`. > > Thank you for plain explanation. > I took the wrong understanding of a slow cause. > I took your advice into

[Prototype-core] Re: Can prototype.js cache an elements?

2009-02-21 Thread sarapapa
Hi, kangax. > Element extension is very slow in JScript, so `$` is not slow due to > `getElementById` but is slow due to `Element.extend`. Thank you for plain explanation. I took the wrong understanding of a slow cause. I took your advice into account and tested it again. A test to read 2,000 D

[Prototype-core] Re: Can prototype.js cache an elements?

2009-02-20 Thread kangax
On Feb 20, 2:30 pm, sarapapa wrote: > Hi all, > I am using prototype.js for a few year. > The issue of JavaScript performance of my Web application occurs > frequently recently. > When it examined a cause, it was to have used many $ method > ("document.getElementById"). > I think that the perform

[Prototype-core] Re: Can prototype.js cache an elements?

2009-02-20 Thread Mislav Marohnić
Hi sarapapa ~ Although the $() function will always be the most frequently used function in your reports, you must take into account that it is also among the fastest. Internally it uses document.getElementById(), which is already very fast in all browsers. Now, a function is not necessarily a per