-
-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a cache for .list() method in FiniteEnumeratedSet #11118
Comments
comment:1
I tried the most elementary solution... It seems to work. Please review, Florent |
comment:2
Here is an advanced solution. Please review. |
This comment has been minimized.
This comment has been minimized.
Changed keywords from list FiniteEnumeratedSet cache to list FiniteEnumeratedSet cache Cernay2012 |
comment:5
Except for a timeout in sage/sandpiles/sandpile.py, all tests passed on sage-5.0.beta2 with the following patches applied::
|
Attachment: trac_11118-finite_enumset_list_cache-fh.patch.gz |
Reviewer: Nicolas M. Thiéry |
Merged: sage-5.0.beta4 |
There are two way to get the list of the elements of a
FiniteEnumeratedSet
:The first case uses
FSet.__iter__
which is slow in many practical case, for example because of deepyield
recursion...After a discussion with Nicolas, We decided the following: In the second case,
we assume that there is a need for speed and therefore we take chance to cache
the list. Here is an example of speedup (needs conbinat patches installed):
CC: @sagetrac-sage-combinat
Component: combinatorics
Keywords: list FiniteEnumeratedSet cache Cernay2012
Author: Florent Hivert
Reviewer: Nicolas M. Thiéry
Merged: sage-5.0.beta4
Issue created by migration from https://trac.sagemath.org/ticket/11118
The text was updated successfully, but these errors were encountered: