From 02b52b2733baf5a65b0e40a376cdb1bba61c8d6c Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 12 Sep 2018 03:39:36 +0000 Subject: make opt_str_freeze leaf Simply use DISPATCH_ORIGINAL_INSN instead of rb_funcall. This is, when possible, overall performant because method dispatch results are cached inside of CALL_CACHE. Should also be good for JIT. ---- trunk: ruby 2.6.0dev (2018-09-12 trunk 64689) [x86_64-darwin15] ours: ruby 2.6.0dev (2018-09-12 leaf-insn 64688) [x86_64-darwin15] last_commit=make opt_str_freeze leaf Calculating ------------------------------------- trunk ours vm2_freezestring 5.440M 31.411M i/s - 6.000M times in 1.102968s 0.191017s Comparison: vm2_freezestring ours: 31410864.5 i/s trunk: 5439865.4 i/s - 5.77x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 50d95610c3..bf886f71f8 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3219,7 +3219,7 @@ vm_opt_str_freeze(VALUE str, int bop, ID id) return str; } else { - return rb_funcall(rb_str_resurrect(str), id, 0); + return Qundef; } } -- cgit v1.2.3