From: Eric Wong Date: 2015-12-09T09:25:00+00:00 Subject: [ruby-core:71990] Re: [Ruby trunk - Feature #11786] [Open] [PATCH] micro-optimize case dispatch even harder SASADA Koichi wrote: > On 2015/12/08 13:53, Eric Wong wrote: > >> > how to mark literal objects? > > Take ideas from nobu (r52708 :) > > I meant marking, not for freeing a table. > > For example, bignum objects should mark from this table. > > ```ruby > case nil > when [bignum literal here] > end > ``` > > (Sorry if I overlooked marking) Wait, putobject calls (and TS_VALUE operands) do not go away when opt_case_dispatch insn is emitted, so marking keys in literal hash is redundant. since iseq_set_sequence adds marks for all TS_VALUE. (but maybe I'm misreading compile.c, too) > I'm not sure it is worth or not. IMO keeping simple with Hash is better > on this case with your measured improvements. Yes, we can revisit after 2.3 release. Maybe this is appropriate for sorted array + bsearch since the table is frozen at compile time and st uses too much memory.