summaryrefslogtreecommitdiff
path: root/test/psych
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-12-22 21:29:00 -0500
committerMarc-André Lafortune <github@marc-andre.ca>2020-12-23 01:08:38 -0500
commitdaec109f423e54094800e083fc8a8ca5cbceb866 (patch)
treef78b987b23611916bd7dba30483e51a56fd5f864 /test/psych
parentc5a445d577b786e31c420b5857ad05b954b420ec (diff)
[ruby/psych] Optimize cache with `compare_by_identity`
Using `compare_by_identity` gives a 4x performance boost on cache hits. Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3953
Diffstat (limited to 'test/psych')
-rw-r--r--test/psych/test_ractor.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/psych/test_ractor.rb b/test/psych/test_ractor.rb
index 90e40360c02..2f8d5ca18de 100644
--- a/test/psych/test_ractor.rb
+++ b/test/psych/test_ractor.rb
@@ -24,6 +24,9 @@ class TestPsychRactor < Test::Unit::TestCase
end
def test_ractor_config
+ # Config is ractor-local
+ # Test is to make sure it works, even though usage is probably very low.
+ # The methods are not documented and might be deprecated one day
assert_ractor(<<~RUBY, require_relative: 'helper')
r = Ractor.new do
Psych.add_builtin_type 'omap' do |type, val|