#5084: speed regression in number of partitons
---------------------------+------------------------------------------------
 Reporter:  robertwb       |        Owner:  mhansen   
     Type:  defect         |       Status:  new       
 Priority:  major          |    Milestone:  sage-3.4.1
Component:  combinatorics  |   Resolution:            
 Keywords:                 |  
---------------------------+------------------------------------------------
Changes (by robertwb):

  * owner:  tbd => mhansen
  * component:  algebra => combinatorics
  * milestone:  => sage-3.4.1

Comment:

 This is due to #3762. It might be nice to either (1) detect whether or not
 quaddouble is available (e.g. if it's on the system or an optional
 installed spkg) and turn on the macro to use it (2) make the mpfr version
 faster. Some timings

 {{{
 %cython
 #clang c++

 from sage.libs.mpfr cimport *
 from sage.rings.real_rqdf cimport *

 def test_mpfr(N, bits=212):
     cdef mpfr_t a, b
     mpfr_init2(a, bits)
     mpfr_init2(b, bits)
     mpfr_random(a)
     mpfr_random(b)
     cdef int i
     for i from 0 <= i < N:
         mpfr_add(a, a, b, GMP_RNDN)
         mpfr_mul(a, a, b, GMP_RNDN)
     mpfr_clear(a)
     mpfr_clear(b)

 def test_qd(N):
     cdef double a[4]
     cdef double b[4]
     cdef int i
     c_qd_rand(a)
     c_qd_rand(b)
     for i from 0 <= i < N:
         c_qd_add(a, a, b)
         c_qd_mul(a, a, b)
 }}}

 and

 {{{
 sage: time test_mpfr(10^6, 212)
 CPU time: 0.34 s,  Wall time: 0.35 s
 sage: time test_mpfr(10^6, 150)
 CPU time: 0.22 s,  Wall time: 0.23 s
 sage: time test_qd(10^6)
 CPU time: 0.25 s,  Wall time: 0.26 s
 }}}

 (OS X 32-bit)

 So there might be hope. Also, the constants calculated up front are used
 to full (1000s of bits) precision throughout, which can slow things down
 in some cases.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5084#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to