[MacRuby] #938: StringScanner Performance

MacRuby ruby-noreply at macosforge.org
Wed Oct 6 17:10:58 PDT 2010


#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/>



More information about the macruby-tickets mailing list