From f7b0a791caaa7c16da4c0afccfde4eaf107e0104 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Wed, 12 Sep 2018 13:32:11 +0000 Subject: _mjit_compile_pc_and_sp.erb: forget about memcpy [ci skip] because using memcpy here actually made performance worse. In Optcarrot, * for loop fps: 55.90428960597268 fps: 57.21690379342434 fps: 58.41751168279789 fps: 58.7317470613203 fps: 62.81371000202459 fps: 63.02541045417479 fps: 63.77324026366317 fps: 65.48067818347447 fps: 66.02324323831398 fps: 66.3816048847424 fps: 66.54526488660156 * memcpy fps: 54.98389812126847 fps: 57.96524857391357 fps: 57.974918725327946 fps: 58.285987089087364 fps: 58.639003211333225 fps: 59.03244214601948 fps: 59.89964772199603 fps: 60.809490242786175 fps: 62.462070790624146 fps: 62.534599002918306 fps: 63.787312566163756 That's probably because the copied size is very small. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tool') diff --git a/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb b/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb index 08aeaee69f..eff728f551 100644 --- a/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb +++ b/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb @@ -21,7 +21,7 @@ rb_snum_t i, push_size; push_size = -<%= insn.call_attribute('sp_inc') %> + <%= insn.rets.size %> - <%= insn.pops.size %>; fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %ld + 1;\n", push_size); /* POPN(INSN_ATTR(popn)); */ - for (i = 0; i < push_size; i++) { /* TODO: use memcpy? */ + for (i = 0; i < push_size; i++) { fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i); } } -- cgit v1.2.3