[MacRuby] #1140: Using regex partitioning is a LOT slower than 1.8.7 or 1.9.2.

MacRuby ruby-noreply at macosforge.org
Sat Jan 29 16:48:11 PST 2011


#1140: Using regex partitioning is a LOT slower than 1.8.7 or 1.9.2.
--------------------------------+-------------------------------------------
 Reporter:  cyberfox@…          |       Owner:  lsansonetti@…        
     Type:  defect              |      Status:  new                  
 Priority:  major               |   Milestone:  MacRuby 0.9          
Component:  MacRuby             |    Keywords:  performance regex    
--------------------------------+-------------------------------------------
 Here's the timings for a relatively simple program.

 (Caveat: Yes, it's using regular expressions to parse HTML; it's a stop-
 gap until I can make Nokogiri work with MacRuby in an app bundle.  The
 point, however, is that partitioning, or some other operation done by this
 code, is somehow a _lot_ slower in MacRuby.)

 The outputs are as follows:

 {{{
 $ rvm system --verbose
 Now using system ruby.
 $ ruby --version
 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
 $ ruby parse_html.rb
 Just partitioning took: 0.0182089805603027
 Number of partitioned splits: 2400
 $ rvm 1.9.2 --verbose
 Using /Users/mrs/.rvm/gems/ruby-1.9.2-p136
 $ ruby parse_html.rb
 Just partitioning took: 0.033324480056762695
 Number of partitioned splits: 2400
 $ macruby parse_html.rb
 Just partitioning took: 1.19672107696533
 Number of partitioned splits: 2400
 $ macruby --version
 MacRuby 0.8 (ruby 1.9.2) [universal-darwin10.0, x86_64]
 }}}

 Attached is a zip file with the HTML being parsed, and the tiny Ruby
 program that's doing it.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1140>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list