зеркало из https://github.com/github/ruby.git
ddb65f0b03
with opt_send_without_block insn if call cache has valid ISeq. If the receiver is not optimized target of opt_key (i.e. Hash or Array), it triggers JIT cancel and it would be slow. This change allows JIT to drop the check for Hash/Array and continue to execute JIT even if the receiver is not Hash or Array. See the following benchmark results. It's not improved so much, but it would be effective when we achieve Ruby method inlining in _mjit_compile_send.erb. * Micro benchmark Given the following bench.rb, ``` class HashWithIndifferentAccess < Hash def []=(key, value) super(key.to_s, value) end def [](key) super(key.to_s) end end indhash = HashWithIndifferentAccess.new indhash[:foo] = 'bar' key = 'foo' 100000000.times do indhash[key] end ``` ** before ``` $ time ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb JIT success (31.4ms): block in <main>@/tmp/bench.rb:15 -> /tmp/_ruby_mjit_p18206u0.c JIT success (669.3ms): []@/tmp/bench.rb:6 -> /tmp/_ruby_mjit_p18206u1.c Successful MJIT finish ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb 12.21s user 0.04s system 107% cpu 11.394 total ``` ** after ``` $ time ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb JIT success (41.0ms): block in <main>@/tmp/bench.rb:15 -> /tmp/_ruby_mjit_p17293u0.c JIT success (679.0ms): []@/tmp/bench.rb:6 -> /tmp/_ruby_mjit_p17293u1.c Successful MJIT finish ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb 11.54s user 0.06s system 108% cpu 10.726 total ``` The execution time is shortened. * optcarrot benchmark Optcarrot has no room to be improved by this change. Almost nothing is changed. fps: 59.54 (before) -> 59.51 (after) * discourse benchmark I expected this to be improved a little, but it isn't too. ** before (JIT) ``` categories_admin: 50: 12 75: 13 90: 14 99: 22 home_admin: 50: 12 75: 13 90: 16 99: 22 topic_admin: 50: 12 75: 13 90: 15 99: 21 categories: 50: 18 75: 19 90: 23 99: 27 home: 50: 3 75: 4 90: 4 99: 12 topic: 50: 11 75: 11 90: 14 99: 20 ``` ** after (JIT) ``` categories_admin: 50: 12 75: 12 90: 16 99: 24 home_admin: 50: 12 75: 12 90: 14 99: 21 topic_admin: 50: 12 75: 13 90: 16 99: 21 categories: 50: 17 75: 18 90: 23 99: 32 home: 50: 3 75: 4 90: 4 99: 10 topic: 50: 11 75: 12 90: 13 99: 20 ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
||
---|---|---|
.. | ||
m4 | ||
ruby_vm | ||
test | ||
asm_parse.rb | ||
bisect.sh | ||
build-transcode | ||
change_maker.rb | ||
checksum.rb | ||
colorize.rb | ||
downloader.rb | ||
enc-emoji-citrus-gen.rb | ||
enc-emoji4unicode.rb | ||
enc-unicode.rb | ||
eval.rb | ||
expand-config.rb | ||
extlibs.rb | ||
fake.rb | ||
fetch-bundled_gems.rb | ||
file2lastrev.rb | ||
gem-unpack.rb | ||
gen_dummy_probes.rb | ||
gen_ruby_tapset.rb | ||
generate-backport-changelog.rb | ||
generic_erb.rb | ||
git-refresh | ||
gperf.sed | ||
id2token.rb | ||
ifchange | ||
insns2vm.rb | ||
install-sh | ||
jisx0208.rb | ||
make-snapshot | ||
make_hgraph.rb | ||
mdoc2man.rb | ||
merger.rb | ||
mk_call_iseq_optimized.rb | ||
mkconfig.rb | ||
mkrunnable.rb | ||
node_name.rb | ||
parse.rb | ||
prereq.status | ||
probes_to_wiki.rb | ||
pull-latest-mspec-spec | ||
rbinstall.rb | ||
rbuninstall.rb | ||
redmine-backporter.rb | ||
release.sh | ||
rmdirs | ||
run-gcov.rb | ||
run-lcov.rb | ||
runruby.rb | ||
strip-rdoc.rb | ||
sync_default_gems.rb | ||
test-coverage.rb | ||
transcode-tblgen.rb | ||
transform_mjit_header.rb | ||
update-deps | ||
vcs.rb | ||
vpath.rb | ||
vtlh.rb | ||
ytab.sed |