ruby-changes:66383
From: Takashi <ko1@a...>
Date: Tue, 1 Jun 2021 14:01:56 +0900 (JST)
Subject: [ruby-changes:66383] 028f1887c2 (master): Change the default --jit-max-cache to 10000
https://git.ruby-lang.org/ruby.git/commit/?id=028f1887c2 From 028f1887c2bfa50dcfc1b623470d6ab1b880fdde Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Mon, 31 May 2021 22:00:14 -0700 Subject: Change the default --jit-max-cache to 10000 This is useful for large applications like Rails. https://k0kubun.medium.com/ruby-3-jit-can-make-rails-faster-756310f235a --- NEWS.md | 5 ++++- mjit.c | 2 +- mjit_worker.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index ac8c30d..6691a0d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -134,7 +134,9 @@ Excluding feature bug fixes. https://github.com/ruby/ruby/blob/trunk/NEWS.md#L134 ### JIT -* `RubyVM::MJIT` is renamed to `RubyVM::JIT`. +* The default `--jit-max-cache` is changed from 100 to 10000. + +* `RubyVM::MJIT` is renamed to `RubyVM::JIT`. [[Feature #17490]] ## Static analysis @@ -162,5 +164,6 @@ Excluding feature bug fixes. https://github.com/ruby/ruby/blob/trunk/NEWS.md#L164 [Feature #17411]: https://bugs.ruby-lang.org/issues/17411 [Bug #17423]: https://bugs.ruby-lang.org/issues/17423 [Feature #17479]: https://bugs.ruby-lang.org/issues/17479 +[Feature #17490]: https://bugs.ruby-lang.org/issues/17490 [Feature #17744]: https://bugs.ruby-lang.org/issues/17744 [Feature #17762]: https://bugs.ruby-lang.org/issues/17762 diff --git a/mjit.c b/mjit.c index e1eb913..035353d 100644 --- a/mjit.c +++ b/mjit.c @@ -598,7 +598,7 @@ system_tmpdir(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L598 // Minimum value for JIT cache size. #define MIN_CACHE_SIZE 10 // Default permitted number of units with a JIT code kept in memory. -#define DEFAULT_MAX_CACHE_SIZE 100 +#define DEFAULT_MAX_CACHE_SIZE 10000 // A default threshold used to add iseq to JIT. #define DEFAULT_MIN_CALLS_TO_ADD 10000 diff --git a/mjit_worker.c b/mjit_worker.c index 306c8cb..6d9ce69 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1396,9 +1396,9 @@ unload_units(void) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1396 void mjit_worker(void) { - // Allow only `max_cache_size / 10` times (default: 10) of compaction. + // Allow only `max_cache_size / 100` times (default: 100) of compaction. // Note: GC of compacted code has not been implemented yet. - int max_compact_size = mjit_opts.max_cache_size / 10; + int max_compact_size = mjit_opts.max_cache_size / 100; if (max_compact_size < 10) max_compact_size = 10; // Run unload_units after it's requested `max_cache_size / 10` (default: 10) times. -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/