| Age | Commit message (Collapse) | Author |
|
`compact_child_nodes` allocates an array. We can skip that step by simply yielding the nodes.
Benchmark for visiting the rails codebase:
```rb
require "prism"
require "benchmark/ips"
files = Dir.glob("../rails/**/*.rb")
results = files.map { Prism.parse_file(it) }
visitor = Prism::Visitor.new
Benchmark.ips do |x|
x.config(warmup: 3, time: 10)
x.report do
results.each do
visitor.visit(it.value)
end
end
end
RubyVM::YJIT.enable
Benchmark.ips do |x|
x.config(warmup: 3, time: 10)
x.report do
results.each do
visitor.visit(it.value)
end
end
end
```
Before:
```
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
2.691 (± 0.0%) i/s (371.55 ms/i) - 27.000 in 10.089422s
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
7.278 (±13.7%) i/s (137.39 ms/i) - 70.000 in 10.071568s
```
After:
```
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
3.429 (± 0.0%) i/s (291.65 ms/i) - 35.000 in 10.208580s
ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +YJIT +PRISM [x86_64-linux]
Warming up --------------------------------------
1.000 i/100ms
Calculating -------------------------------------
16.815 (± 0.0%) i/s (59.47 ms/i) - 169.000 in 10.054668s
```
~21% faster on the interpreter, ~56% with YJIT
https://github.com/ruby/prism/commit/bf631750cf
|
|
It's https://rubygems.org/gems/sexp_processor, not https://rubygems.org/gems/sexp
https://github.com/ruby/prism/commit/b8a00a5f15
|
|
ruby_parser.
Had to add a require of sexp since that came in indirectly via ruby_parser.
https://github.com/ruby/prism/commit/df677c324f
|
|
Tests were failing in Flay under Prism.
https://github.com/ruby/prism/commit/af9b3640a8
|
|
Symbol#name is only a thing since Ruby 3.0
https://github.com/ruby/prism/commit/2de82b15fc
|
|
https://github.com/ruby/prism/commit/9f55551b09
|
|
https://github.com/ruby/prism/commit/c2e372a8d8
|
|
https://github.com/ruby/prism/commit/571ba378f5
|
|
https://github.com/ruby/prism/commit/641775e5fe
|
|
https://github.com/ruby/prism/commit/12af4e144e
|
|
https://github.com/ruby/prism/commit/7a93a307ac
|
|
https://github.com/ruby/prism/commit/8d9d429155
|
|
https://github.com/ruby/prism/commit/b283a72c88
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
Followup to https://github.com/ruby/prism/pull/3079
https://github.com/ruby/prism/commit/68f434e356
|
|
Fixes [Bug #20744]
https://github.com/ruby/prism/commit/f1b8b1b2a2
|
|
Rename some fields that do not quite make sense.
* CaseMatchNode#consequent -> CaseMatchNode#else_clause
* CaseNode#consequent -> CaseNode#else_clause
* IfNode#consequent -> IfNode#subsequent
* RescueNode#consequent -> RescueNode#subsequent
* UnlessNode#consequent -> UnlessNode#else_clause
Notes:
Merged: https://github.com/ruby/ruby/pull/11480
|
|
https://github.com/ruby/prism/commit/afc7c9344a
|
|
https://github.com/ruby/prism/commit/47cb73ce69
|
|
https://github.com/ruby/prism/commit/073e8ba307
|
|
https://github.com/ruby/prism/commit/6f886be0a4
|
|
https://github.com/ruby/prism/commit/4b06eae0df
|
|
https://github.com/ruby/prism/commit/53bbcfe513
|
|
https://github.com/ruby/prism/commit/79cec4be22
|
|
https://github.com/ruby/prism/commit/d4eb13e703
|
|
https://github.com/ruby/prism/commit/b5e47f5c42
|
|
This has been requested for a long time, and I'm finally doing it
now. Unfortunately this is a breaking change for all of the APIs.
I've added in a Ruby method for `#child` that is deprecated so that
existing usage doesn't break, but for everyone else this is going
to be a bit of a pain.
https://github.com/ruby/prism/commit/9cbe74464e
|
|
https://github.com/ruby/prism/commit/e4d6984892
|
|
https://github.com/ruby/prism/commit/b0fa4b7cd8
|
|
for RubyParser translation
https://github.com/ruby/prism/commit/a37169621a
|
|
https://github.com/ruby/prism/commit/473cfed6d0
|
|
https://github.com/ruby/prism/commit/5cf5f15ee7
|
|
https://github.com/ruby/prism/commit/1925b970c7
|