Project

General

Profile

« Previous | Next » 

Revision c2d8d6eb

Added by Eregon (Benoit Daloze) over 1 year ago

Initialize the Prism::Source directly with all 3 fields for the C extension

  • 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