#11740: reading integers from a file takes quadratic time
--------------------------------+-------------------------------------------
Reporter: zimmerma | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.7.2
Component: basic arithmetic | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
--------------------------------+-------------------------------------------
Comment(by leif):
Replying to [comment:3 nbruin]:
> I think it's python's string-to-int routine ... [[BR]]
> [[BR]]
> I see the following solutions: [[BR]]
> - fix python's string-to-int to run in O(input size)
That would be best, but we may get in trouble with Python upgrades.
(Should get reported upstream if appropriate though.)
Have you already identified Python's bad code?
[[BR]]
> - change the preparser to generate Integer('100') instead of
Integer(1000)
That would give quite surprising results... (Do you intend to scale
''all'' integers by 0.1, or just replace 1000 by 100? The former would
indeed improve the performance.) ;-)
Most probably the easiest (or quickest) way to fix this, though we have
different source files for the preparser code (IIRC) which always have to
be kept in sync, which is odd as well. (And the preparser is subject to
other changes, too.)
[[BR]]
> Option number one has the biggest benefit because that has a chance of
improving python for everyone.
''In principle''^TM^ yes. Best when a suitable fix is submitted upstream
(and accepted of course).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11740#comment:5>
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 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.