Skip to content

Commit 2415d4d

Browse files
author
Release Manager
committed
sagemathgh-40734: Avoid mutate Integer.value at a few more places, remove sig_occurred() check in Integer fast_tp_dealloc Follow-up to sagemath#40556. Now the `sig_occurred()` check in `fast_tp_dealloc` is removed. ------ This is the effect on the last commit, changing `divisors()` to use `sig_check()`. Before: ``` sage: n = prod(primes_first_n(17)) ....: %timeit ignore = n.divisors() 20 ms ± 245 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: n = prod(primes_first_n(17)) ....: %timeit ignore = n.divisors() 20.5 ms ± 616 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: n = prod(primes_first_n(17)) ....: %timeit ignore = n.divisors() 20 ms ± 302 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) ``` After: ``` sage: n = prod(primes_first_n(17)) ....: %timeit ignore = n.divisors() 20.6 ms ± 424 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: n = prod(primes_first_n(17)) ....: %timeit ignore = n.divisors() 20.5 ms ± 254 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: n = prod(primes_first_n(17)) ....: %timeit ignore = n.divisors() 20.7 ms ± 206 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) ``` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40734 Reported by: user202729 Reviewer(s):
2 parents 9d039fe + da6ef59 commit 2415d4d

File tree

2 files changed

+140
-111
lines changed

2 files changed

+140
-111
lines changed

src/sage/libs/gmp/mpz.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from libc.stdio cimport FILE
66

77
from libc.stdint cimport intmax_t, uintmax_t
88

9-
cdef extern from "gmp.h":
9+
cdef extern from "gmp.h" nogil:
1010

1111
### Integer Functions ###
1212

0 commit comments

Comments
 (0)