From: s.wanabe@... Date: 2018-03-07T13:02:52+00:00 Subject: [ruby-core:85967] [Ruby trunk Feature#14489] MJIT needs a reusable cache Issue #14489 has been updated by wanabe (_ wanabe). File 14489.patch added .o file may be reusable if it can be separated from embedded value. How about `extern const TYPE var;` place holders and other .c file that defines `const TYPE var = (val)`? Here is a just PoC patch based on r62681 and a result example. ``` $ rm -r ~/.cache/ruby-mjit $ time ruby --jit-wait --jit-cache-objs -e 'nil' real 0m18.714s user 0m17.718s sys 0m1.828s $ time ruby --jit-wait --jit-cache-objs -e 'nil' real 0m1.656s user 0m1.289s sys 0m0.650s $ time ruby --jit-wait -e 'nil' real 0m16.731s user 0m15.989s sys 0m1.236s $ find ~/.cache/ruby-mjit -name "*.o"|wc -l 87 ``` ---------------------------------------- Feature #14489: MJIT needs a reusable cache https://bugs.ruby-lang.org/issues/14489#change-70833 * Author: sam.saffron (Sam Saffron) * Status: Rejected * Priority: Normal * Assignee: k0kubun (Takashi Kokubun) * Target version: ---------------------------------------- Currently on Discourse boot I notice a few minutes of jitting every time you boot it: This is a redacted output: https://gist.github.com/SamSaffron/4e18c2dacf476f1f27275f5b5d7bbb97 CPU is spinning hard compiling temp file after temp file for **minutes**: > JIT success (213.1ms): platform_string@/home/sam/.rbenv/versions/master/lib/ruby/gems/2.6.0/gems/bundler-1.16.1/lib/bundler/lazy_specification.rb:18 -> /tmp/_ruby_mjit_p6914u199.c and so on. Instead, mjit should have a reusable cache on disk it first tries fetching from prior to re-compiling. It can use an ISEQ SHA1 hash as the key to the cache. ---Files-------------------------------- 14489.patch (29.8 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: