From 609939f8c6cb595eaa7d36eee030e8c10c6f6ad9 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 6 Jun 2018 20:57:48 +0000 Subject: rb_vm_insn_addr2insn: use st to perform addr2insn mapping The current VM_INSTRUCTION_SIZE is 198, so the linear search painful during a major GC phase. I noticed rb_vm_insn_addr2insn2 showing up at the top of some profiles while working on some malloc-related stuff, so I decided to attack it. Most notably, the benchmark/bm_vm3_gc.rb improves by over 40%: https://80x24.org/spew/20180602220554.GA9991@whir/raw [ruby-core:87361] [Feature #14814] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 1 + 1 file changed, 1 insertion(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index da3bcadb42..aff1b9021b 100644 --- a/eval.c +++ b/eval.c @@ -66,6 +66,7 @@ ruby_setup(void) #endif Init_BareVM(); Init_heap(); + rb_addr2insn_init(); Init_vm_objects(); EC_PUSH_TAG(GET_EC()); -- cgit v1.2.3