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

Comment (by SimonKing):

 With the current branch, I get
 {{{
 sage: from sage.misc.lazy_string import lazy_string, _LazyString
 sage: f=lambda :"hi"
 sage: s=_LazyString(f,(), {})
 sage: %timeit str(s)
 The slowest run took 21.90 times longer than the fastest. This could mean
 that an intermediate result is being cached
 1000000 loops, best of 3: 827 ns per loop
 }}}
 With the change that Nils suggested in comment:29, I get
 {{{
 sage: from sage.misc.lazy_string import lazy_string, _LazyString
 sage: f=lambda :"hi"
 sage: s=_LazyString(f,(), {})
 sage: %timeit str(s)
 The slowest run took 11.15 times longer than the fastest. This could mean
 that an intermediate result is being cached
 1000000 loops, best of 3: 535 ns per loop
 }}}
 Pushing the change...

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