-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
SR.var('x', domain='real') and assume(x, 'real') are very slow #30065
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
|
comment:3
Gets slower every time.
|
Commit: |
comment:5
Some low-hanging fruit here. New commits:
|
comment:6
|
comment:7
More can be done by caching diff --git a/src/sage/symbolic/assumptions.py b/src/sage/symbolic/assumptions.py
index 3e0ca736ba..827ab61b67 100644
--- a/src/sage/symbolic/assumptions.py
+++ b/src/sage/symbolic/assumptions.py
@@ -71,11 +71,13 @@ Assumptions are added and in some cases checked for consistency::
from sage.structure.sage_object import SageObject
from sage.rings.all import ZZ, QQ, RR, CC
from sage.symbolic.ring import is_SymbolicVariable
+from sage.structure.unique_representation import UniqueRepresentation
+
_assumptions = []
_valid_feature_strings = set()
-class GenericDeclaration(SageObject):
+class GenericDeclaration(UniqueRepresentation):
"""
This class represents generic assumptions, such as a variable being
an integer or a function being increasing. It passes such ... but the semantics of the |
comment:9
I'll investigate further improvements on follow-up tickets. Needs review |
Author: Matthias Koeppe |
comment:10
Follow-up: #30074 |
comment:11
Perhaps it would be better to do -_valid_feature_strings = set(repr(x).strip() for x in list(maxima("features")))
+_valid_feature_strings.update(repr(x).strip() for x in list(maxima("features"))) so it doesn't overwrite the |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
Good idea, done. |
Reviewer: Travis Scrimshaw |
comment:14
Thanks. |
comment:15
Thank you! |
comment:16
Patchbot is complaining. Apparently, this is due to the preexisting code (line 971): https://www.flake8rules.com/rules/E701.html Should this be fixed right on the fly? |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits: |
comment:19
Actually no, this ticket is already on Volker's branch. |
comment:20
I've put the commit on #30074 instead |
Changed branch from u/mkoeppe/faster_maxima_assumptions to |
(from #30061)
See also:
CC: @egourgoulhon @sagetrac-tmonteil @orlitzky
Component: symbolics
Author: Matthias Koeppe
Branch/Commit:
1fbfb68
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/30065
The text was updated successfully, but these errors were encountered: