RubyIO#incrementLineno is Very Slow
-----------------------------------

                 Key: JRUBY-4117
                 URL: http://jira.codehaus.org/browse/JRUBY-4117
             Project: JRuby
          Issue Type: Bug
          Components: Performance
    Affects Versions: JRuby 1.5
            Reporter: R.J. Lorimer


Through analysis of JRUBY-2810 I found that RubyIO#incrementLineno is 
indirectly invoked by all line-retrieving methods in RubyIO, including 
RubyIO#foreach and RubyIO#each_line. On large files this shows up as the 
largest offender in profiles, consuming nearly 40% of the total execution time.

It isn't clear through initial analysis why it is there, but if it is required, 
a more optimal path should be considered to improve large file scanning 
performance.

Please see http://gist.github.com/213949 for timings with and without 
incrementLineno. (Please note that these timings were all captured using the 
modified 'bench_io_foreach.rb' from the patch proposed on JRUBY-2810 - please 
use that version to do comparisons, as it has very difference characteristics 
than the current version in master).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to