#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|  af6750bdb2ff7d8a6b234cf3f021e2f603030be6
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Next, I wish to address the slowness of `LazyFormat`. We have
 {{{
 sage: from sage.misc.lazy_format import LazyFormat
 sage: form = LazyFormat("<%s>")
 sage: cform = LazyFormat(""+form)
 sage: cform
 unbound LazyFormat("<%s>")
 sage: %timeit copy(form)
 The slowest run took 9.12 times longer than the fastest. This could mean
 that an intermediate result is being cached
 100000 loops, best of 3: 16.3 µs per loop
 sage: %timeit LazyFormat(""+form)
 The slowest run took 12.69 times longer than the fastest. This could mean
 that an intermediate result is being cached
 1000000 loops, best of 3: 395 ns per loop
 }}}
 So, this is what we could use in `__mod__` for speed-up

--
Ticket URL: <http://trac.sagemath.org/ticket/14585#comment:46>
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.

Reply via email to