Explicit return from block much slower than MRI
-----------------------------------------------

                 Key: JRUBY-2589
                 URL: http://jira.codehaus.org/browse/JRUBY-2589
             Project: JRuby
          Issue Type: Bug
          Components: Performance
    Affects Versions: JRuby 1.1.1
         Environment: ruby 1.8.6 (2008-05-28 rev 6586) [i386-jruby1.1.2]
java version "1.5.0_13"
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]

            Reporter: Tyler Jennings
            Priority: Minor
         Attachments: bench_return_from_block.rb

Performance for an explicit return from a block is very slow compared with MRI. 
 See attached benchmark.  

> jruby -J-server bench_return_from_block.rb 
Block without return
  1.136000   0.000000   1.136000 (  1.136000)
  0.856000   0.000000   0.856000 (  0.856000)
  0.853000   0.000000   0.853000 (  0.854000)
  0.835000   0.000000   0.835000 (  0.835000)
  0.832000   0.000000   0.832000 (  0.832000)
Block with return
  3.264000   0.000000   3.264000 (  3.264000)
  3.205000   0.000000   3.205000 (  3.205000)
  3.185000   0.000000   3.185000 (  3.185000)
  3.179000   0.000000   3.179000 (  3.179000)
  3.187000   0.000000   3.187000 (  3.187000)

> ruby bench_return_from_block.rb 
Block without return
  0.810000   0.010000   0.820000 (  0.811569)
  0.800000   0.000000   0.800000 (  0.809030)
  0.810000   0.000000   0.810000 (  0.810357)
  0.810000   0.000000   0.810000 (  0.814052)
  0.800000   0.010000   0.810000 (  0.806928)
Block with return
  1.260000   0.000000   1.260000 (  1.261678)
  1.250000   0.010000   1.260000 (  1.264366)
  1.270000   0.000000   1.270000 (  1.272686)
  1.260000   0.000000   1.260000 (  1.261558)
  1.250000   0.010000   1.260000 (  1.258746)


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