Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Pack small hash tables (up to 6 entries) #84
Patch uses same technique as used for numhashes in trunk for packing tables of other types as well.
Also it use pointers in
It gives great speedup for creating small hashes, and little overhead for bigger hashes. It gives very countable memory footprint reduction.
Investigation shows, that typical rails application allocates tons of small hashes. Up to 40% of whole allocated hashes never grows bigger than 1 element size.
Combined with #83 , it is faster than ruby-trunk even for hashes of sizes 7-10.
Performance testing using C extension is here https://gist.github.com/1626602 (also pool allocation patch tested here).
@nobu , but how then we should workaround hash behaviour? When we call to
Valuable option (as I think) is add
What is your opinion?
we've had some resque workers get stuck in an infinite loop during a find_entry (st.c) call with a 4 element cycle with this ultra packed perf patch. our build didn't include the 6270762 sha. problem doesn't seem to manifest under ruby-1.9.3_p125. it pains me to post this without a repro.
Hi, rboyd. I know about rare stuck with my performance patch :(
So that, I think ruby trunk has no bug.
Please, test tcs-ruby or ruby-trunk, not this pull request or previous version of patch.