Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Faster Hash#slice (esp. when key count increases)

#297

See title.

I claim no credit for this patch: credit goes to Grant Hollingworth (see http://merb.lighthouseapp.com/pr...). Just want to get it into Rails since it's trivial. I didn't replicate the Hash#except patch (until someone or I am able to profile memory usage).

Benchmark I used included. These are my results:

                     user     system      total        real
small hash#slice_current  1.210000   0.000000   1.210000 (  1.216810)
small hash#slice_patched  0.870000   0.000000   0.870000 (  0.871604)
                     user     system      total        real
big hash#slice_current  0.720000   0.000000   0.720000 (  0.717137)
big hash#slice_patched  0.020000   0.000000   0.020000 (  0.024483)

Reported by Cheah Chu Yeow · June 2nd, 2008 @ 09:46 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Cheah Chu Yeow
  2. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to resolved

    952ec79bec313e0001adfc8c86f7970448d32db9

    June 2nd, 2008 @ 07:48 PM