#13991: Mitigate speed regressions in symmetric function related code due to 
#12313
---------------------------------+------------------------------------------
       Reporter:  nbruin         |         Owner:  sage-combinat
           Type:  enhancement    |        Status:  new          
       Priority:  major          |     Milestone:  sage-5.7     
      Component:  combinatorics  |    Resolution:               
       Keywords:                 |   Work issues:               
Report Upstream:  N/A            |     Reviewers:               
        Authors:                 |     Merged in:               
   Dependencies:                 |      Stopgaps:               
---------------------------------+------------------------------------------

Comment (by SimonKing):

 I don't think that `Partitions(n)` has ever been cached. `Partitions` is a
 function which apparently does not use a cache, and the object returned by
 `Partitions(1)` is not an instance of `UniqueRepresentation`.

 Actually, Partitions(1) is not a unique parent - and I think this actually
 is the problem. Namely, we have
 {{{
 sage: P = Partitions(1)
 sage: P is Partitions(1)
 False
 sage: P == Partitions(1)
 True
 }}}

 In the old way of caching homsets, domain and codomain were tested for
 equality. But now, they are tested for ''identity''. Hence, we now have
 {{{
 sage: H = Hom(Partitions(0),SymmetricFunctionAlgebra(QQ))
 sage: H is Hom(Partitions(0),SymmetricFunctionAlgebra(QQ))
 False
 }}}
 which used to return True, because Hom was caching by equality.

 Hence, rather than having less caching, I actually suggest to have
 ''more'' caching in this case: `Partitions_n` should inherit from
 `UniqueRepresentation`, or, if this is impossible, `Partitions` should be
 equipped with a cache.

 This cache should either be a weak cache, or it should be semi-weak (e.g.,
 cache the output of `Partitions(n)` permanently for `n<256`, but weakly
 for greater values).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13991#comment:13>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to