#4941: pari list slicing is extremely slow -- make it much faster
-------------------------+--------------------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.2.3
Component: interfaces | Keywords:
-------------------------+--------------------------------------------------
The following illustrates that list slicing in Pari is ridiculously slow.
{{{
sage: time p=pari.prime_list(10^6)
CPU times: user 0.06 s, sys: 0.02 s, total: 0.08 s
Wall time: 0.09 s
sage: len(p)
1000000
sage: time c=p[0:]
CPU times: user 45.05 s, sys: 0.54 s, total: 45.59 s
Wall time: 46.20 s
}}}
The code responsible for this is in pari/gen.pyx (line 825 in sage-3.2.3)
in __getitem__:
{{{
elif PyObject_TypeCheck(n, slice):
l = glength(self.g)
inds = _normalize_slice(n, l)
k = len(inds)
v = P.vector(k)
for i in range(k):
v[i] = self[inds[i]]
return v
}}}
There must be dramatically faster ways to do a list slice in pari than the
above.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4941>
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
-~----------~----~----~----~------~----~------~--~---