#11332: 65x penalty in performance for using float instead of RealNumber
----------------------------+----------------------------------------------
       Reporter:  pang      |        Owner:  burcin
           Type:  defect    |       Status:  needs_review
       Priority:  major     |    Milestone:  sage-duplicate/invalid/wontfix
      Component:            |   Resolution:
  symbolics                 |    Merged in:
       Keywords:  float,    |    Reviewers:
  RealNumber                |  Work issues:
        Authors:            |       Commit:
Report Upstream:  N/A       |     Stopgaps:
         Branch:            |
   Dependencies:            |
----------------------------+----------------------------------------------

Comment (by vdelecroix):

 Replying to [comment:8 mmezzarobba]:
 > Fixed?
 >
 > {{{
 > sage: sage: x=random()
 > sage: sage: y=RealNumber(x)
 > sage: sage: z=RDF(x)
 > sage: sage: timeit('exp(x)')
 > 625 loops, best of 3: 17.7 µs per loop
 > sage: sage: timeit('exp(y)')
 > 625 loops, best of 3: 5.9 µs per loop
 > sage: sage: timeit('exp(z)')
 > 625 loops, best of 3: 2.29 µs per loop
 > }}}

 Half
 {{{
 sage: x = random()
 sage: timeit('exp(x)', number=50000)
 50000 loops, best of 3: 8.15 µs per loop
 sage: from math import exp as math_exp
 sage: timeit('math_exp(x)', number=50000)
 50000 loops, best of 3: 290 ns per loop
 }}}
 just 30x slower. Better than the 65x that was reported for the difference
 between `float` and `RR`.

--
Ticket URL: <http://trac.sagemath.org/ticket/11332#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to