-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Colin Mollenhour wrote:
(I was able to reproduce your results, only mine were a lot faster
across the board, what CPU are you using?)

As already mentioned, I run all the tests with ten thousands iterations
(vs the default "one thousand" value which I suppose you used too).

My tests were done on a very "experimentalish" Linux system, host
processors are "Intel(R) Pentium(R) 4 CPU 3.00GHz", each guest host
having 512MB RAM allocated (no swapping occured during tests).

Sorry about this misleading "trick", 1K is a safe default for people who
want to get a quick glance, but I used a larger samples number to get
more trustworthy results. OFC, I could have used even more iterations,
but 10K was enough to get a smooth variation between different
executions (at least for those "Prototypish" methods).
For instance, a 100K run on Firefox will show similar results (comparing
to previous rating):

Browser: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1)
Gecko/20061222 Firefox/2.0.0.1
Timing 100000 iterations of Prototype, Prototype-oneDiv, String.replace,
String.split...
      Prototype:  27.664s @   3615/s (n=100000)
Prototype-oneDiv:  39.626s @   2524/s (n=100000)
 String.replace:   8.138s @  12288/s (n=100000)
   String.split:  12.519s @   7988/s (n=100000)
                   Rate Prototype-oneDiv Prototype String.split
String.replace
Prototype-oneDiv  2524/s               --      -30%         -68%
  -79%
      Prototype  3615/s              43%        --         -55%
  -71%
   String.split  7988/s             217%      121%           --
  -35%
 String.replace 12288/s             387%      240%          54%
    --
Tests duration: 87.947 seconds.
Total duration: 103.594 seconds.

Even though String.replace is slower in Opera I'd be in favor of it since Opera clearly has some room for improvement with that function
so I'm guessing this may be improved in the future.

Hm, as previously stated, browsers behave very different, and
S�bastien's tests just completed the picture. Thanks.
I wonder, even after running all these tests, which would be the really
best overall choice? I for one cannot clearly see a winner. OFC, YMMV.

I remember I worked long time ago on a tool that consolidates different
runs of the same benchmark, I guess it could help us getting a better
overview... but I'm a mess, have no idea about the when, where or for.
Anyway, should be simple enough to write from scratch (maybe even in
JavaScript)... we'll see. ;-)

Browser dependent implementations could be a choice, but really!?! Is
this the way to go? I really doubt it, and I'm sure many will second me
on this one, based on previous conversation, both on this list and on
our bug tracker.

Sure, we should work on optimizing things, but I'm not too sure about
this particular case ("escapeHTML"). In this case, maybe settling to
your previous solution (avoiding escapeHTML for Builder.node attributes)
would be a safer resolution for now, even if it's plain wrong (purist
talk here: if one test fails, everything should get back to the drawing
board). I know, web developers are not generally like that, as they're
getting disappointed every day by existent "platforms".

cheers.
- --
Marius Feraru
-----BEGIN PGP SIGNATURE-----

iD8DBQFFn2P3tZHp/AYZiNkRAqKPAKCI3V2dyByhVHgfcs67TUPTZLlRAACgtE+t
HHrFr6kNgBzUmoYQ7wlAG8Q=
=Xz9L
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to