-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
[with (new) second patch, positive review] integer shifting slow #6118
Comments
Attachment: 6118-integer-shift.patch.gz |
comment:1
Before
After
|
comment:3
Thumbs up from me. The patch successfully applied to my 4.0 install and the tests in integer.pyx pass. This patch is important for mpmath performance (#6196). Time for sage.libs.mpmath.all.runtests() without patch = 63.66 seconds, with patch = 51.88 seconds. |
comment:4
I'm definitely happy with this patch. As Robert points out in the patch, there are a few inconsistencies in some of the Interestingly, I'm having some funny results using
As you can see, it's generally around
I tend to trust it, because it's running a ton of loops -- maybe the fact that my computer is doing several things at once is disturbing Anyway, new patch attached. Robert, if you could look over the changes, I'd say this is a positive review. It seems to give me a nominally faster (around |
comment:5
I just realized this touched integer.pxd, so some comments first. We care about shifting by ints a lot because library code (especially mpmath) does a lot of stuff like "x << 1". I think the patch may make that path slower. Also, the error checking and cpdefing may make it slower too (I'll test, might be negligible). Also, why do
rather than
|
comment:6
Here's after just the first patch:
and after the second patch
With repeated timings, the variance seems to be about 5 or so ns. The only significant differences are that Integer >> Integer is a bit faster with the second patch, and Integer << int and Integer >> int are faster with the first. I'm (pleasantly) surprised making it a cpdef function didn't slow it down. I don't think |
comment:7
Attachment: trac-6118-pt2.patch.gz I've added a new version of the second patch, which mostly just adds comments and removes the inconsistencies with things like In particular, I've come around to Robert's point that we want to speed up the One last question, though -- do we really need the case where |
Reviewer: Mike Hansen, Craig Citro |
comment:8
I think that Craig's patch looks good, and his question shouldn't really hold this up. I'll open a new ticket for that so that these can go in. |
Author: Robert Bradshaw, Craig Citro |
comment:9
I got some hunk failures when applying
This needs a rebase against Sage 4.1.2.alpha1 or a later version. |
comment:10
Minh, were you applying both patches? The second applies on top of the first. |
comment:11
mhansen -- what's up? a bunch of us are at the HUB working on Sage... |
comment:12
Both patches should be applied -- not just the last one. |
Merged: sage-4.2.alpha0 |
Component: basic arithmetic
Author: Robert Bradshaw, Craig Citro
Reviewer: Mike Hansen, Craig Citro
Merged: sage-4.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/6118
The text was updated successfully, but these errors were encountered: