#4939: [with patch; with positive review] massive performance regression to
primes_first_n
---------------------------+------------------------------------------------
Reporter: was | Owner: was
Type: defect | Status: new
Priority: blocker | Milestone: sage-3.2.3
Component: number theory | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by cremona):
Here's what is taking the time when leave_pari=True:
{{{
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
sage: time c=p
CPU times: user 0.07 s, sys: 0.00 s, total: 0.07 s
Wall time: 0.07 s
}}}
If you were to change the line
{{{
if leave_pari:
return v[m:]
}}}
to
{{{
if leave_pari:
if m==0:
return v
return v[m:]
}}}
then it would have been faster. But as William said, this option seems
not to be worth keeping anyway.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4939#comment:4>
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
-~----------~----~----~----~------~----~------~--~---