| Age | Commit message (Collapse) | Author |
|
namespace
https://github.com/ruby/prism/commit/0e4dbcd3e4
|
|
https://github.com/ruby/prism/commit/537947aa5c
|
|
https://github.com/ruby/prism/commit/acdff3aae3
|
|
* The stdlib StringIO is synchronized and this occurs a high overhead.
* This is about twice as fast on TruffleRuby but surprisingly it is slower on JRuby.
I am not sure why but probably @ivar access and integer arithmetic
is much slower than Java field access/arithmetic on JRuby.
* On CRuby interpreter it is slower, which is expected as the GVL already protects StringIO.
* So we enable this only on TruffleRuby to not slow down other Rubies.
* PRISM_FFI_BACKEND=true ruby -v -Ilib -rprism -rbenchmark -e '300.times { p Benchmark.realtime { Dir.glob("lib/**/*.rb") { |f| Prism.parse_file(f) } } }'
ruby 3.3.0: 0.215 => 0.251 (cext: 0.062)
ruby 3.3.0 YJIT: 0.118 => 0.113 (cext: 0.053)
truffleruby JVM: 0.101 => 0.054
jruby 9.4.6.0: 0.162 => 0.219
jruby 9.4.6.0 indy: 0.078 => 0.086
* For the record here are the numbers for using the String directly, without a StringIO-like object:
ruby 3.3.0: 0.215 => 0.234 (cext: 0.062)
ruby 3.3.0 YJIT: 0.118 => 0.111 (cext: 0.053)
truffleruby native: 0.101 => 0.053
jruby 9.4.6.0: 0.162 => 0.195
jruby 9.4.6.0 indy: 0.078 => 0.082
As we can see, that extra object adds a non-trivial overhead on CRuby interpreter and JRuby.
But we need to make it possible to use StringIO and SimpleStringIO interchangeably.
https://github.com/ruby/prism/commit/938677cbd2
|
|
- Add `x` prefix to malloc, calloc, realloc, and free
(eg: malloc -> xmalloc)
- By default, they are replaced with stdlib's functions at build
- You can use custom functions by defining `PRISM_CUSTOM_ALLOCATOR` macro
https://github.com/ruby/prism/commit/7a878af619
|
|
Prism::Serialize::Loader#load_location
* Following the changes in #2428.
* PRISM_FFI_BACKEND=true ruby -v -Ilib -rprism -rbenchmark -e '10.times { p Benchmark.realtime { Dir.glob("lib/**/*.rb") { |f| Prism.parse_file(f) } } }'
ruby 3.3.0: 0.255 => 0.210
ruby 3.3.0 YJIT: 0.150 => 0.120
https://github.com/ruby/prism/commit/fabf809bbf
|
|
https://github.com/ruby/prism/commit/4ef4032774
|
|
https://github.com/ruby/prism/commit/f731edcc26
|
|
https://github.com/ruby/prism/commit/b7959295e9
|
|
* To avoid duplication.
https://github.com/ruby/prism/commit/12e5aae0b4
|
|
$CHECK_FIELD_KIND
https://github.com/ruby/prism/commit/33e987ba3c
|
|
https://github.com/ruby/prism/commit/322eaea500
|
|
https://github.com/ruby/prism/commit/959eb506ca
|
|
https://github.com/ruby/prism/commit/7905bdbf83
|
|
Also remove RBS for currently ignored files. Will follow-up when those
check fully in later PRs.
https://github.com/ruby/prism/commit/2cae58f86d
|
|
https://github.com/ruby/prism/commit/9f00fe7510
|
|
https://github.com/ruby/prism/commit/5fda7a0760
|
|
https://github.com/ruby/prism/commit/0209d093ec
|
|
https://github.com/ruby/prism/commit/99a71675d4
|
|
https://github.com/ruby/prism/commit/eabed9f4fd
|
|
|
|
https://github.com/ruby/prism/commit/fa9a30ad91
|
|
https://github.com/ruby/prism/commit/3e10c46c14
|
|
https://github.com/ruby/prism/commit/9137226a52
|
|
|
|
https://github.com/ruby/prism/commit/120d8c0479
|
|
https://github.com/ruby/prism/commit/6d4cd21e98
|
|
interface is available in the target platform
https://github.com/ruby/prism/commit/88e2ff52d4
|
|
https://github.com/ruby/prism/commit/4510e2746d
|
|
https://github.com/ruby/prism/commit/d3a149efc5
|
|
https://github.com/ruby/prism/commit/851f2571ff
|
|
* Before it could result in NoMethodError if multiple threads were
calling location methods: https://gist.github.com/eregon/b78b7f266d7ee0a278a389cfd1782232
https://github.com/ruby/prism/commit/ff762dcccd
|
|
|
|
When creating the Ruby AST, we were previously allocating Location
objects for every node and every inner location. Instead, this
commit changes it to pack both the start offset and length into a
single u64 and pass that into the nodes. Then, when the locations
are requested via a reader method, we lazily allocate the Location
objects.
https://github.com/ruby/prism/commit/de203dca83
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
|
|
|
|
* It is quite a bit faster:
ruby -rbenchmark/ips -e 'Benchmark.ips { |x| x.report("times.map") { 1000.times.map {} }; x.report("Array.new") { Array.new(1000) {} }; x.compare! }'
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
Warming up --------------------------------------
times.map 976.000 i/100ms
Array.new 1.641k i/100ms
Calculating -------------------------------------
times.map 9.808k (± 0.3%) i/s - 49.776k in 5.075013s
Array.new 16.601k (± 1.0%) i/s - 83.691k in 5.041970s
Comparison:
Array.new: 16600.8 i/s
times.map: 9808.2 i/s - 1.69x slower
|
|
* Faster that way:
$ ruby -Ilib -rprism -rbenchmark/ips -e 'Benchmark.ips { |x| x.report("parse") { Prism.parse("1 + 2") } }'
195.722k (± 0.5%) i/s
rb_iv_set():
179.609k (± 0.5%) i/s
rb_funcall():
190.030k (± 0.3%) i/s
before this PR:
183.319k (± 0.4%) i/s
|
|
* As the user should not set these.
* Use #instance_variable_set/rb_iv_set() instead internally.
https://github.com/ruby/prism/commit/cace09fb8c
|
|
* Fixes https://github.com/ruby/prism/issues/2380
https://github.com/ruby/prism/commit/4eaaa90114
|
|
|
|
https://github.com/ruby/prism/commit/cf0369a5c7
|
|
https://github.com/ruby/prism/commit/19ffa0b980
|
|
|
|
https://github.com/ruby/prism/commit/1a15b70a8e
|
|
https://github.com/ruby/prism/commit/f3030cb2b2
|
|
|
|
https://github.com/ruby/prism/commit/f81fe9c716
Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com>
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
|
|
|
|
https://github.com/ruby/prism/commit/a35b8e45ee
|
|
Split up the diagnostic levels so that error and warning levels
aren't mixed. Also fix up deconstruct_keys implementation.
https://github.com/ruby/prism/commit/bd3eeb308d
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
|