Based on the table shuffling code of the recent cljs thread "Randomize
HTML Table Rows from JavaScript " (http://tinyurl.com/56g37t), I get
this results :
e.replaceChild() (SAM's code) :
FF2 : 1x
FF3: 1.3x
Opera 9.5 : 4.8x
Safari r34469 : 8.4x
e.insertBefore() (Thomas' code) :
FF2 : 1x
FF3: 1.2x
Opera 9.5 : 4.7x
Safari r34469 : 10.8x
e.appendChild() (Jorge's code) :
FF2 : 1x
FF3: 1.1x
Opera 9.5 : 4.3x
Safari r34469 : 10.2x
As the JavaScript core (Sun Spider : webkit.org/perf/sunspider-0.9/
sunspider.html) benchmarks were already showing, Safari is the
fastest, but I wasn't expecting such **huge** differences in DOM
manipulation speeds...
The data : (got it on my Mac/OS 10.5.3)
FF2.0.0.14
159.1/100 ms (SAM)
104.2/100 ms (Thomas)
88.66/100 ms (Jorge)
FF3.0
123.23/100 ms (SAM)
86.7/100 ms (Thomas)
83.72/100 ms (Jorge)
Opera 9.5
33.25/100 ms (SAM)
22.33/100 ms (Thomas)
20.61/100 ms (Jorge)
Safari/WebKit r34469 :
18.92/100 ms (SAM)
9.69/100 ms (Thomas)
8.72/100 ms (Jorge)
Take it with a grain of salt.
--Jorge.