#14585: Make lazy_format and lazy_string faster
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner: robertwb
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.4
Component: coercion | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/SimonKing/Make_lazy_format_faster| 2eab18c54d05655257042468503dcf75c3baaa33
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by SimonKing):
The improvement is clear:
Old version:
{{{
sage: from sage.misc.lazy_format import LazyFormat
sage: form = LazyFormat("<%s>")
sage: %timeit form%"hi"
10000 loops, best of 3: 22 µs per loop
}}}
New version:
{{{
sage: from sage.misc.lazy_format import LazyFormat
sage: form = LazyFormat("<%s>")
sage: form%"hi"
<hi>
sage: %timeit form%"hi"
The slowest run took 6.91 times longer than the fastest. This could mean
that an intermediate result is being cached
1000000 loops, best of 3: 1.28 µs per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/14585#comment:48>
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/d/optout.