diff options
| author | Aaron Patterson <tenderlove@ruby-lang.org> | 2025-02-13 09:56:21 -0800 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2025-02-14 14:39:35 -0500 |
| commit | 8cafa5b8ce5e35881bf5077d2bfafc03274189f2 (patch) | |
| tree | 6e9c50df55391f49a4c31c24cd331b5e0f3f368c /test/ruby | |
| parent | c1ce3d719dab2761fbca37f9336a33b47af187ed (diff) | |
Only count VM instructions in YJIT stats builds
The instruction counter is slowing multi-Ractor applications. I had
changed it to use a thread local, but using a thread local is slowing
single threaded applications. This commit only enables the instruction
counter in YJIT stats builds until we can figure out a way to gather the
information with lower overhead.
Co-authored-by: Randy Stauner <randy.stauner@shopify.com>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12670
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_yjit.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 0e476588f4..c0212987e7 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -1637,7 +1637,7 @@ class TestYJIT < Test::Unit::TestCase [ stats[:object_shape_count].is_a?(Integer), - stats[:ratio_in_yjit].is_a?(Float), + stats[:ratio_in_yjit].nil? || stats[:ratio_in_yjit].is_a?(Float), ].all? RUBY end @@ -1648,7 +1648,7 @@ class TestYJIT < Test::Unit::TestCase 3.times { test } # Collect single stat. - stat = RubyVM::YJIT.runtime_stats(:ratio_in_yjit) + stat = RubyVM::YJIT.runtime_stats(:yjit_alloc_size) # Ensure this invocation had stats. return true unless RubyVM::YJIT.runtime_stats[:all_stats] |
