diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-12-22 21:29:00 -0500 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-23 18:38:27 +0900 |
commit | a2dd8d846da9648aa74b266337429a0ab53d7bd3 (patch) | |
tree | 140f870efc83667463f75d11e40c10f6e9e06142 /test | |
parent | d4861854ecde00540c527f36aaacd257e63ed5a4 (diff) | |
download | psych-a2dd8d846da9648aa74b266337429a0ab53d7bd3.zip |
[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
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/test_ractor.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/psych/test_ractor.rb b/test/psych/test_ractor.rb index 90e4036..2f8d5ca 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| |