diff options
author | Ufuk Kayserilioglu <[email protected]> | 2025-05-22 16:32:04 +0300 |
---|---|---|
committer | git <[email protected]> | 2025-05-23 14:22:47 +0000 |
commit | 224a02f924967066fc5c784c2f4a75eea52b11b4 (patch) | |
tree | dff7ae613748c333e89350053551f3a91ccd400a /class.c | |
parent | 70f8f7c4b11da8e237dc312a76ac49ebe0b66333 (diff) |
[ruby/prism] Monomorphise visitor methods
The current implementation of the visitor pattern in Prism uses
a single method (`visit_child_nodes`) to handle all node types. This can lead to performance issues since the `node` argument will end up being polymorphic, and will prevent effective use of inline caches, which in CRuby are monomorphic.
This commit generates an inlined version of the previous code for each node type, thus making the calls inside visitor methods monomorphic. This should improve performance, especially in cases where the visitor is called frequently.
https://github.com/ruby/prism/commit/60d324a701
Diffstat (limited to 'class.c')
0 files changed, 0 insertions, 0 deletions