JRuby 10x slower than Ruby on "Wide Finder" script
--------------------------------------------------

                 Key: JRUBY-1661
                 URL: http://jira.codehaus.org/browse/JRUBY-1661
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.1
         Environment: Darwin xxxxxxx.local 9.1.0 Darwin Kernel Version 9.1.0: 
Wed Oct 31 17:48:21 PDT 2007; root:xnu-1228.0.2~1/RELEASE_PPC Power Macintosh
            Reporter: Dave Halliday
            Assignee: Thomas E Enebo


I'm filing this bug in response to Charlie's "Benchmarking JRuby" post on the 
mailing list.

The script from Tim Bray's "Wide Finder" project runs about 10x slower with 
JRuby than Ruby on my iMac G5 (even if you discount the Java startup time).

counts = {}
counts.default = 0

ARGF.each_line do |line|
  if line =~ %r{GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/\d\d/[^ .]+) }
    counts[$1] += 1
  end
end

keys_by_count = counts.keys.sort { |a, b| counts[b] <=> counts[a] }
keys_by_count[0 .. 9].each do |key|
  puts "#{counts[key]}: #{key}"
end

Sample data is available here:

http://www.tbray.org/tmp/o10k.ap

I replicated the data 100 times to get a file with one million records.  It 
took about 4 seconds for Ruby to crank through it and about 40 seconds for 
JRuby.  I ran the test on r5150 of the trunk, so the joni code is included.  
Still some work to be done on each_line I guess?




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