#15862: Mutability of tableaux, for the n-th time
-------------------------------------------------+-------------------------
       Reporter:  darij                          |        Owner:
           Type:  defect                         |       Status:  new
       Priority:  major                          |    Milestone:  sage-6.2
      Component:  combinatorics                  |   Resolution:
       Keywords:  tableaux, sage-combinat,       |    Merged in:
  mutability                                     |    Reviewers:
        Authors:                                 |  Work issues:
Report Upstream:  N/A                            |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------

Comment (by darij):

 `t = map(tuple, t)` sounds like a good idea to me. The immutability of the
 outer list is handled by `CombinatorialObject`, so we only need to care
 about the inner ones.

 Is `_repr_` slowdown important? That is, is `_repr_` used in any non-IO
 contexts such as hashing and caching? (I know it sometimes is; the
 question whether it is here.)

 Is `_repr_` the only thing that gets slowed down if we replace the (inner)
 lists by tuples? I'd say it should be, because any method on tableaux that
 needs to mess around with rows as lists currently needs to clone them
 before doing so, and experiments tell me that `t[:]` is considerably
 faster when `t` is a tuple than when `t` is a list:
 {{{
 sage: g = tuple(range(15))
 sage: %timeit g[:]
 10000000 loops, best of 3: 73.4 ns per loop
 sage: g = range(15)
 sage: %timeit g[:]
 1000000 loops, best of 3: 197 ns per loop
 sage: g = tuple(range(3))
 sage: %timeit g[:]
 10000000 loops, best of 3: 73.4 ns per loop
 sage: g = range(3)
 sage: %timeit g[:]
 10000000 loops, best of 3: 158 ns per loop
 }}}

 ***

 This might and not might be related, but do you have any idea where the
 slowdowns in http://trac.sagemath.org/ticket/14711#comment:107 come from?
 (I'm aware that running all doctests in series is not the scientific way
 of assessing performance, but I'm still worried about tableaux getting
 slower...)

--
Ticket URL: <http://trac.sagemath.org/ticket/15862#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 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/groups/opt_out.

Reply via email to