summaryrefslogtreecommitdiff
path: root/benchmark/vm1_gc_short_with_complex_long.yml
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-12-11 13:10:39 -0800
committerAaron Patterson <tenderlove@github.com>2019-12-17 09:19:00 -0800
commitd7a50a5cc694ab28608a9d5a2e39c2766330ffe6 (patch)
treeb07ca44076f0b641f32cddd1a71d3a72d3871a99 /benchmark/vm1_gc_short_with_complex_long.yml
parent8a40dce0ff2964df22e06ae9a08f50592d17caf0 (diff)
downloadruby-d7a50a5cc694ab28608a9d5a2e39c2766330ffe6.tar.gz
Avoid revisiting seen nodes clearing method cache
rb_clear_method_cache_by_class calls rb_class_clear_method_cache recursively on subclasses, where it will bump the class serial and clear some other data (callable_m_tbl, and some mjit data). Previously this could end up taking a long time to clear all the classes if the module was included a few levels deep and especially if there were multiple paths to it in the dependency tree (ie. a class includes two modules which both include the same other module) as we end up revisiting class/iclass/module objects multiple times. This commit avoids revisiting the same object, by short circuiting when revisit the same object. We can check this efficiently by comparing the class serial of each object we visit with the next class serial at the start. We know that any objects with a higher class serial have already been visited.
Diffstat (limited to 'benchmark/vm1_gc_short_with_complex_long.yml')
0 files changed, 0 insertions, 0 deletions