Re: Comparison of Euphoria vs Perl, Python, PHP

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeremy Cowgar wrote:
> 
> Matt,
> 
> Something is wrong with map:new()... On your example, I shaved 15 seconds off
> (comparing to my own box) by using map:new() instead of map:new(1000)... It
> took 15 seconds for map:new(1000) to return!!?!?

Heh.  Told you I didn't do much.  Or even have a good understanding of
map.e. :)

I just figured that I was going to have a lot of keys, and wanted to avoid
hash collisions.

I reverted to a regular map:new(), and got 7 seconds faster.  Then I turned
off type checking, and got another 12 seconds.  Then I added a function in
map.e to do the addition for me, instead of having to get the value, do the
addition, and then put the value (it's almost identical to put(), but if
the value exists, it adds to the existing value rather than replaces it).
That bought me another 4 seconds.

Before:
real    1m29.448s
user    1m28.722s
sys     0m0.620s

After:
real    1m6.097s
user    1m4.928s
sys     0m0.688s

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu