#864: Asymptotically slow PARI --> Python long conversions
-------------------------------+----------------------------
       Reporter:  craigcitro   |        Owner:  craigcitro
           Type:  enhancement  |       Status:  needs_review
       Priority:  minor        |    Milestone:  sage-5.12
      Component:  performance  |   Resolution:
       Keywords:  pari         |    Merged in:
        Authors:  Peter Bruin  |    Reviewers:
Report Upstream:  N/A          |  Work issues:
         Branch:               |       Commit:
   Dependencies:               |     Stopgaps:
-------------------------------+----------------------------
Changes (by {'newvalue': u'Peter Bruin', 'oldvalue': ''}):

 * status:  new => needs_review
 * author:   => Peter Bruin
 * component:  interfaces => performance
 * upstream:   => N/A


Comment:

 I am uploading a patch that implements conversion from PARI `t_INT` to
 Python long via an intermediate `mpz_t`, so `long(y)` essentially does
 `long(Integer(y))`.

 Some timings:
 {{{
 sage: x = 10^1000000
 sage: %timeit y=pari(x)
 10000 loops, best of 3: 197 us per loop
 sage: %timeit z=Integer(y)
 100 loops, best of 3: 4.11 ms per loop
 sage: %timeit u=long(y)
 100 loops, best of 3: 13 ms per loop
 sage: %timeit u=long(Integer(y))
 100 loops, best of 3: 13.8 ms per loop

 sage: x = 10^10000000
 sage: %timeit y=pari(x)
 100 loops, best of 3: 5.57 ms per loop
 sage: %timeit z=Integer(y)
 100 loops, best of 3: 2.94 ms per loop
 sage: %timeit u=long(y)
 100 loops, best of 3: 13.9 ms per loop
 sage: %timeit u=long(Integer(y))
 100 loops, best of 3: 13.8 ms per loop
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/864#comment:4>
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/groups/opt_out.

Reply via email to