#20943: Update a missing important speed improvement for subword complexes
-------------------------------------+-------------------------------------
       Reporter:  stumpc5            |        Owner:
           Type:  enhancement        |       Status:  positive_review
       Priority:  major              |    Milestone:  sage-7.3
      Component:  combinatorics      |   Resolution:
       Keywords:  reflection group,  |    Merged in:
  coxeter group, subword complex,    |
  days80                             |
        Authors:  Christian Stump    |    Reviewers:  Frédéric Chapoton
Report Upstream:  N/A                |  Work issues:
         Branch:  u/stumpc5/20943    |       Commit:
                                     |  6f2172b794ec53d55bd7920125b92662dc17edc8
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Just FYI - calling a `@cached_method` is ~10% slower than a (Python)
 attribute lookup:
 {{{#!python
 sage: class Foo(object):
 ....:     def __init__(self, x):
 ....:         self.x = x
 ....:         self._y = x
 ....:     @cached_method
 ....:     def y(self):
 ....:         return self._y
 ....:
 sage: F = Foo(5)
 sage: %timeit F.x
 The slowest run took 73.41 times longer than the fastest. This could mean
 that an intermediate result is being cached.
 10000000 loops, best of 3: 42.2 ns per loop
 sage: %timeit F.y()
 The slowest run took 2799.35 times longer than the fastest. This could
 mean that an intermediate result is being cached.
 10000000 loops, best of 3: 57.1 ns per loop
 }}}
 However, it is better code (IMO) to use the cached method mechanism, and
 it makes it easier to change/override it.

--
Ticket URL: <https://trac.sagemath.org/ticket/20943#comment:28>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to