[MacRuby] #938: StringScanner Performance
#938: StringScanner Performance --------------------------------+------------------------------------------- Reporter: murphy@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: StringScanner, benchmark --------------------------------+------------------------------------------- The StringScanner seems to have quadratic, rather than linear, running time (based on the input's length). I've performed a series of simple benchmark with MacRuby 0.7 and MRI 1.9.2: {{{ time [mac]ruby -rstrscan -e 's = StringScanner.new("abc," * XX_000); s.scan(/./) until s.eos?' }}} The results are shown in the attached diagram. The issue is problematic because the time it takes to scan Strings bigger than a few KiB is too long. This makes the tests for the CodeRay library (see http://redmine.rubychan.de/projects/coderay/wiki/Test_Suite) effectively fail. -- Ticket URL: <http://www.macruby.org/trac/ticket/938> MacRuby <http://macruby.org/>
#938: StringScanner Performance --------------------------------+------------------------------------------- Reporter: murphy@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby Later Component: MacRuby | Keywords: StringScanner, benchmark --------------------------------+------------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby Later Comment: Looks like a bug for Later. However, MacRuby's strscan library is in pure Ruby, maybe there are some low hanging optimizations waiting to be implemented in the file. -- Ticket URL: <http://www.macruby.org/trac/ticket/938#comment:1> MacRuby <http://macruby.org/>
#938: StringScanner Performance --------------------------------+------------------------------------------- Reporter: murphy@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby Later Component: MacRuby | Keywords: StringScanner, benchmark --------------------------------+------------------------------------------- Comment(by murphy@…): Rubinius uses optimized Oniguruma methods to avoid this problem: https://github.com/evanphx/rubinius/blob/master/lib/strscan.rb#L264 -- Ticket URL: <http://www.macruby.org/trac/ticket/938#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby