[MacRuby] #1075: rdoc is way too slow as of r5059

MacRuby ruby-noreply at macosforge.org
Thu Dec 23 02:44:42 PST 2010


#1075: rdoc is way too slow as of r5059
-----------------------------------+----------------------------------------
 Reporter:  lsansonetti@…          |       Owner:  lsansonetti@…        
     Type:  defect                 |      Status:  new                  
 Priority:  blocker                |   Milestone:                       
Component:  MacRuby                |    Keywords:                       
-----------------------------------+----------------------------------------

Comment(by vincent.isambart@…):

 Before the new string, the characters were often stored internally in
 UTF-16, so finding what was at a specific index was very fast. In the new
 strings, the characters are always stored in their original encoding so
 getting a character at a specific index is much harder and slower.

 I won't go back to the previous version of string because they were too
 dangerous to use in a multithreaded environment.

 However the changes commited in r5077 should make String much faster.

 What I did was write a version of str_update_flags and
 str_get_character_boundaries specific for UTF-8 and changed a few checks
 to make ASCII-only strings in an ASCII-compatible encoding (that includes
 of course UTF-8) VERY fast.

 Looking at the Shark profile after my changes, we could do better be a bit
 faster though because now a lot of time is spent in memory allocations
 done by str_resize_bytes (called indirectly by rb_ary_join). Making a big
 memory allocation from the start would probably make that faster.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1075#comment:2>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list