Slow Jscript objects response with large number of objects

From: Arvind (Arvind_at_discussions.microsoft.com)
Date: 03/14/05


Date: Mon, 14 Mar 2005 03:11:05 -0800

I am experiencing slow response by Jscript object access and creation
functions when large numbers of custom objects are created on a page. Same
code in Firefox and Netscape works fine and there is no slowness in creation
of execution of objects. Attached is a simple html page with javascript
(http://www.geocities.com/arvindsagarwal/test.htm) to demostrate that (htm
file contains inline javascript).

Results which i got in IE 6 with XP SP2 with all latest patches and latest
version 5.6 of scripting host installed, (Similar behaviour noticed on
different machines with Windows Server or Windows XP OS)
1) Create 10000 Objects took 220ms
2) Create 10000 Objects Second Time took 210ms

3) Making Collection of 10000 objects took 742ms

4) Create 10000 Objects after creation of collection took 711ms
5) Create 10000 Objects second time after creation of collection took 701ms

6) Creating 10000 objects after destroying the collection took 250ms
7) Creating 10000 objects second time after destroying the collection took
210ms

In the above results, 1 & 2 are time it took to create 10000 objects, these
objects were not added to any collection and destroyed immediately upon
creation.
Now in 3 again the 10000 objects got created but this time they are added to
a collection
Now in 4 & 5 same code as 1 & 2 which took around 200ms now takes 700 ms to
create the objects. - This is the problem.
Now if we destroy the collection and execute the same object creation code
as 1 & 2 it again goes back to normal performance as 1 & 2.

Hence there seems to be some problem when large number of objects exists in
the memory and Jscript is incremently getting slowed down as a result all
dynamic operations on the page appers to be very slow. We are developing a
rich client side application on browser and this is causing some unacceptable
delayes in loading and accessing the information on the page.

I also tried to run the above page on Mozilla Firefox 1.0 browser installed
in the same machine, here are the results
1) Create 10000 Objects took 60ms
2) Create 10000 Objects Second Time took 70ms

3) Making Collection of 10000 objects took 110ms

4) Create 10000 Objects after creation of collection took 60ms
5) Create 10000 Objects second time after creation of collection took 80ms

6) Creating 10000 objects after destroying the collection took 90ms
7) Creating 10000 objects second time after destroying the collection took
50ms

If you notice there is no delay in object creation here and objects are
created much much faster.

Results on Netscape 7.2 Installed on the same machine.

1) Create 10000 Objects took 160ms
2) Create 10000 Objects Second Time took 140ms

3) Making Collection of 10000 objects took 201ms

4) Create 10000 Objects after creation of collection took 140ms
5) Create 10000 Objects second time after creation of collection took 160ms

6) Creating 10000 objects after destroying the collection took 180ms
7) Creating 10000 objects second time after destroying the collection took
141ms

again, if you notice above no additional delay is introduced while creating
or accessing objects event with large number of objects in the memory.

---------------------------
I have also done the similar test using a js
(http://www.geocities.com/arvindsagarwal/test.js) file, which can be executed
using WSH and it shows exactly the same results, this makes be believe that
the issue lies with Jscript Script engine itself and not specific to IE.

I will appreciate a quick response on this, and any workarounds or patches
to go around this issue will be highly appreciated

Thanks,
Arvind



Relevant Pages

  • Re: Slow Jscript objects response with large number of objects
    ... >| code in Firefox and Netscape works fine and there is no slowness in creation ... Create 10000 Objects after creation of collection took 469ms ... Create 10000 Objects second time after creation of collection took ... Creating 10000 objects second time after destroying the collection ...
    (microsoft.public.scripting.jscript)
  • Javascript Performance Leaks and IE?
    ... To replicate the bug, go to the site, press refresh multiple ... Create 10000 Objects second time after creation of collection took ... Creating 10000 objects second time after destroying the collection ...
    (comp.lang.javascript)
  • Re: Hypothetical dinner party...
    ... like Howard Roark in "The Fountainhead" argues when he is in court ... accused of destroying his own creation, ... AND BUILT: ...
    (rec.music.beatles)
  • Re: Hypothetical dinner party...
    ... On Oct 13, 8:19 pm, AllaBest wrote: ... accused of destroying his own creation, ... AND BUILT: ...
    (rec.music.beatles)
  • Re: Slow Jscript objects response with large number of objects
    ... >| particular machine or fact that it is taking lesser time in firefox to create ... And as the number of objects increase some how Jscript keeps ... >| web page subsquent calls to creation of object starts taking incremently more ... And functionality which works absolutely well in Netscape and Firefox ...
    (microsoft.public.scripting.jscript)

Loading