From: Eric Wong Date: 2014-05-21T01:27:03+00:00 Subject: [ruby-core:62700] Re: [PREVIEW] enc: convert some case fold tables to ihash Nobuyoshi Nakada wrote: > (2014/05/21 7:03), Eric Wong wrote: > > Not a serious patch, yet, but this saves over 100K as measured with: > Rather I'd like to convert these tables to perfect hashes. OK, I'll have to look more into that. > > Download: http://80x24.org/casefold-ihash.patch http://80x24.org/casefold-ihash.patch > > Why removed `const`s? I embed the rb_ihash_node struct into the original Case*Type structs. rb_ihash_add_direct writes directly to the rb_ihash_node struct to avoid per-entry allocation. We avoid (1357 + 1207) mallocs for st_table_entry this way. Also, I'm looking at ccan[1] htable instead of ihash. It is currently LGPL, but based on ccan commit d4941bf8047d16007f19a3b5b2211e1e7571f068, relicensing to BSD/CC0 is a possiblility. [1] git://git.ozlabs.org/~ccan/ccan