Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The method pAdicGeneric.integer_ring() uses LocalGeneric.change() to turn a p-adic field into a p-adic ring. The latter calls a factory function which, by default, checks primality of p. However, when p came from a Qp this step is not necessary. We avoid it by adding `check=False` to the call to `LocalGeneric.change()` in `pAdicGeneric.integer_ring()`. This results in significant time savings for large primes, e.g. in the current test suite: Before this commit: ``` sage: R = Qp(next_prime(10^60)) sage: timeit('R.integer_ring()') 25 loops, best of 3: 22.2 ms per loop sage: %time TestSuite(R).run() CPU times: user 14.4 s, sys: 44 µs, total: 14.4 s Wall time: 14.4 s ``` After this commit: ``` sage: R = Qp(next_prime(10^60)) sage: timeit('R.integer_ring()') 625 loops, best of 3: 68 μs per loop sage: %time TestSuite(R).run() CPU times: user 714 ms, sys: 239 µs, total: 715 ms Wall time: 717 ms ``` Doctest of `padic_base_leaves.py` goes down from ~33 to ~5 seconds.
- Loading branch information