#13991: Mitigate speed regressions in symmetric function related code due to
#12313
----------------------------------+-----------------------------------------
Reporter: nbruin | Owner: sage-combinat
Type: task | Status: new
Priority: major | Milestone: sage-5.8
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: #13605, #14225 | Stopgaps:
----------------------------------+-----------------------------------------
Comment (by nbruin):
Replying to [comment:45 SimonKing]:
> What do you think?
I think that ''if'' it is indeed the case that Partitions get deleted and
recreated often and ''if'' that is resulting in unacceptable slowdowns,
then someone who understands the usage scenarios should look at `k_dual`
and ensure that the right partitions are kept around for long enough by
installing a strong reference somewhere. I think making functions
`cached_function` willy nilly is a bad approach because it gives you poor
control over the lifetime.
Expecting that `Partitions(n)` will (eventually) be cheap is a bad
programming paradigm. I don't think we're making parents
`UniqueRepresentation` as a speed optimization of creation. I think we're
doing that because it's required for efficient coercion.
Thus, whenever code has `Partitions(n)` in its inner loop, the
consequences are for that code.
If you're absolutely intent on making `TestSuite(F).run()` perform better,
I think it's much more productive to understand why running the testsuite
a second time gives much better performance. There must be plenty of
caching happening already.
The most important value of this exercise I think is as a case-study into
the pitfalls of getting good performance relating to complicated parent
structures. I'd hope you'll eventually find some general guidelines people
should follow if they want their code to perform reasonably well.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13991#comment:47>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.