Extremely slow performance when dividing or multiplying a float by/to a fixnum
------------------------------------------------------------------------------

                 Key: JRUBY-4693
                 URL: http://jira.codehaus.org/browse/JRUBY-4693
             Project: JRuby
          Issue Type: Bug
         Environment: Mac OS X 10.6, MacBook Pro 2.53, 4GB
            Reporter: Stevie Graham
            Assignee: Thomas E Enebo
            Priority: Minor
             Fix For: JRuby 1.4


Multiplying by a reciprocal (float) is extremely slow. The difference in 
performance between division and multiplication is far greater than on any 
other vm.

e.g.

require 'benchmark'

Benchmark.bmbm do |x|
  x.report("divide:")   { 9999999.times { 999999999 / 8 } }
  x.report("multiply:") { 9999999.times { 999999999 * 0.125 } }
end

Rehearsal ---------------------------------------------
divide:     1.960000   0.000000   1.960000 (  1.783000)
multiply:  21.506000   0.000000  21.506000 ( 21.505000)
----------------------------------- total: 23.466000sec

                user     system      total        real
divide:     1.962000   0.000000   1.962000 (  2.079000)
multiply:  23.535000   0.000000  23.535000 ( 23.535000)


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