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
shortcut coercion for Integer-Rational operations #20731
Comments
This comment has been minimized.
This comment has been minimized.
Branch: u/vdelecroix/20731 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
Move |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
I think that |
comment:8
|
comment:9
Right, but that's a rather artificial example. What about simple cases? |
comment:10
In |
comment:11
I just thought about the following very simple algorithm for the multiplication (division is analogous): To compute You don't need to canonicalize the final result, since |
comment:14
[comment:10] |
comment:35
Replying to @videlec:
This was in reference to comment:31, where I was thinking the issue with the time difference might be something in mpz instead of something we are doing in Sage. It might be better to take the faster version and utilize that addition/multiplication is commutative to get that extra little bit of speed. |
comment:36
Replying to @tscrim:
There is no fundamental difference between |
Reviewer: Jeroen Demeyer, Travis Scrimshaw |
comment:37
Ah, I see it now. I guess the only difference is checking
I'm happy with this ticket as-is. Jeroen, any more comments? |
comment:38
One way to shortcut the |
comment:39
I was originally thinking that we should keep it as |
comment:40
hum... with
with
|
comment:41
Independent time testing with a Cython class (without inheritance)
I guess something else is happening with |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:43
That really suggests that it has to do with the MRO length (comment:37), but I am somewhat surprised that does matter. Well, this is a definite improvement and should get into 7.3. |
comment:44
|
comment:45
Dear Volker, I am not able to reproduce this... could you tell us on which kind of configuration you obtained that? Vincent |
comment:46
I think the test is just fragile:
vs the actual output:
Note the path is |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/vdelecroix/20731 to |
Doing some shortcut to coercion actually fasten the code by a factor 3...
Old version
New version
CC: @jdemeyer
Component: coercion
Keywords: days74
Author: Vincent Delecroix
Branch/Commit:
d535aee
Reviewer: Jeroen Demeyer, Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/20731
The text was updated successfully, but these errors were encountered: