- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Coercion from ZZ['x']
to Integers(n)['x']
is VERY slow
#13257
Comments
comment:1
Pruning the command shows the whole time is spent calling
|
comment:2
As a point of comparison, if we convert the polynomial back into a list then the operation runs about 500x faster:
So we probably have a 'lost in coercion' situation here. |
This comment has been minimized.
This comment has been minimized.
comment:4
The main problem is in compiled files (which is why Where the time is taken is each time a monomial is added, a new polynomial is created. A partial solution is to convert polynomial inputs in Best, Travis |
Author: Travis Scrimshaw |
comment:5
Well, I should say that's where it used to be...it's now in Something even more scary to me, this did not scale linearly with
However I'm uploading a patch which just checks if it is a polynomial, and if so, it handles it as if it were a list. With the patch:
To be honest, I'm still not perfectly happy with this solution since feels like a hack. If someone else can find an example of a significant slowdown which is not caught by this patch, please share. However as it stands, this patch is ready for review. Best Travis |
comment:6
Won't this patch break
I think polynomial_template should be fixed, at the cost of requiring a couple more special methods. |
comment:7
Replying to @robertwb:
Yes it does:
I'll see what I can do. Thanks, Travis |
Changed implementation |
Changed keywords from none to days45 |
comment:8
Attachment: trac_13257-modn_conversion_speedup-ts.patch.gz I've changed the fix to have My timings with the patch:
Ready for review again. Thanks, Travis |
Reviewer: Jean-Pierre Flori |
comment:9
I think the horrible horror has been fixed in #12173 itself. So I propose to close this as duplicate. |
Changed author from Travis Scrimshaw to none |
comment:10
Agreed. On
|
As reported by Fredrik Johansson in #12173 this is a horrible horror:
CC: @fredrik-johansson @sagetrac-jlopez @simon-king-jena
Component: coercion
Keywords: days45
Reviewer: Jean-Pierre Flori
Issue created by migration from https://trac.sagemath.org/ticket/13257
The text was updated successfully, but these errors were encountered: