-
Notifications
You must be signed in to change notification settings - Fork 31
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
Lagrange interpolation speed problem #427
Comments
I will start looking into this. One tip you may not be aware of. The primary time hog in generating the large BeforeIn [1]: import galois
In [2]: %time GF = galois.GF(21888242871839275222246405745257275088696311157297823662689037894645226208583)
CPU times: user 1min 6s, sys: 0 ns, total: 1min 6s
Wall time: 1min 6s
In [3]: print(GF.properties)
Galois Field:
name: GF(21888242871839275222246405745257275088696311157297823662689037894645226208583)
characteristic: 21888242871839275222246405745257275088696311157297823662689037894645226208583
degree: 1
order: 21888242871839275222246405745257275088696311157297823662689037894645226208583
irreducible_poly: x + 21888242871839275222246405745257275088696311157297823662689037894645226208580
is_primitive_poly: True
primitive_element: 3 AfterIn [1]: import galois
In [2]: %time GF = galois.GF(21888242871839275222246405745257275088696311157297823662689037894645226208583, primitive_element=3, verify=False)
CPU times: user 578 µs, sys: 872 µs, total: 1.45 ms
Wall time: 1.45 ms
In [3]: print(GF.properties)
Galois Field:
name: GF(21888242871839275222246405745257275088696311157297823662689037894645226208583)
characteristic: 21888242871839275222246405745257275088696311157297823662689037894645226208583
degree: 1
order: 21888242871839275222246405745257275088696311157297823662689037894645226208583
irreducible_poly: x + 21888242871839275222246405745257275088696311157297823662689037894645226208580
is_primitive_poly: True
primitive_element: 3 |
That's definitely helpful, thanks! Though, just to clarify, the time spent generating GF wasn't taken into the performance comparisons. It was mostly lagrange_poly vs vanilla_interpolate |
I think Lagrange interpolation using this library is way slower than using vanilla python (+ numpy). Below is the code I used to test this. Sorry if it's not too clean, I just grabbed a few minutes to repurpose some code from another project and put this together.
This worked with multiple combinatios of (q, r).
(1, 3) had ~20x difference.
(10, 360) 150x difference.
(224, 1110) took Galois almost two hours.
Let me know if you need anything else.
The text was updated successfully, but these errors were encountered: