Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-35455: Faster get_unsafe for NTL GF(p) polynomials
### 📚 Description Unlike similar Zmod(n) polynomials, the GF(p) NTL polynomials would call the IntegerModRing constructor for each get_unsafe call resulting in very slow polynomial evaluation. Benchmarks: ``` p = next_prime(2**80) pol = GF(p)["x"].random_element(80000) # Before # evaluate pol at a random GF(p) element: 260.6ms # evaluate pol at a random GF(p^2) element: 790.1ms # evaluate pol at a random GF(p^5) element: 1155.8ms # After # evaluate pol at a random GF(p) element: 66.8ms # evaluate pol at a random GF(p^2) element: 541.2ms # evaluate pol at a random GF(p^5) element: 889.9ms ``` ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] 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 accordingly. URL: #35455 Reported by: Rémy Oudompheng Reviewer(s): Marc Mezzarobba, Rémy Oudompheng
- Loading branch information