Skip to content
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

Creation of polynomials over finite fields is quite slow #23470

Open
xcaruso opened this issue Jul 19, 2017 · 3 comments
Open

Creation of polynomials over finite fields is quite slow #23470

xcaruso opened this issue Jul 19, 2017 · 3 comments

Comments

@xcaruso
Copy link
Contributor

xcaruso commented Jul 19, 2017

On my laptop, it takes almost 1 second to create a polynomial of degree 10000 over F_125:

    sage: k = GF(5^3)
    sage: S.<x> = k[]
    sage: L = [ k.random_element() for _ in range(10000) ]
    sage: %time f = S(L)
    CPU times: user 764 ms, sys: 4 ms, total: 768 ms
    Wall time: 767 ms

while computing its square takes only 40ms:

    sage: %time g = f*f
    CPU times: user 32 ms, sys: 8 ms, total: 40 ms
    Wall time: 39.6 ms

CC: @jpflori

Component: finite rings

Keywords: sd87, padicIMA

Issue created by migration from https://trac.sagemath.org/ticket/23470

@xcaruso xcaruso added this to the sage-8.1 milestone Jul 19, 2017
@jpflori
Copy link

jpflori commented Jul 19, 2017

comment:1

This is already way too slow:

sage: K = GF(125)
sage: R = K['t']
sage: L = [K.random_element() for _ in range(10**5)]
sage: %timeit [c.polynomial() for c in L]
1 loop, best of 3: 7.32 s per loop
sage: KK = GF(125, impl="pari_ffelt")
sage: RR = KK['t']
sage: LL = [KK.random_element() for _ in range(10**5)]
sage: %timeit [c.polynomial() for c in LL]
1 loop, best of 3: 13.7 s per loop

@jpflori
Copy link

jpflori commented Jul 30, 2017

comment:2

There is a lot of python overhead to do magic conversion btw different C implementations.
So unless we implement special methods to go back and forth specific implementations it looks hard to tackle that one in a generic way.

@roed314
Copy link
Contributor

roed314 commented Jul 22, 2018

Changed keywords from sd87 to sd87, padicIMA

@mkoeppe mkoeppe removed this from the sage-8.1 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants