ruby/ruby — pull request #84 by funny-falcon (2012-01-17 13:55:53+00:00)
Title: Pack small hash tables (up to 6 entries) 

Patch uses same technique as used for numhashes in trunk for packing tables of other types as well.

Also it use pointers in `st_table` structure (bins, head, tail) for packing tables of size 0 and 1, so that they need not to allocate bins at all.

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).