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

benchmarks for sparse polynomial methods #88

Open
1e9abhi1e10 opened this issue Jun 27, 2023 · 4 comments
Open

benchmarks for sparse polynomial methods #88

1e9abhi1e10 opened this issue Jun 27, 2023 · 4 comments

Comments

@1e9abhi1e10
Copy link
Contributor

@oscarbenjamin I want to know whether I create a new file or add a benchmark in the benchmarks/polys.py file.
Also, should I add all benchmarks which were I commented on the Issue.

@oscarbenjamin
Copy link
Contributor

It would be good to have a polynomial benchmarks file if there is not already somewhere that has polynomial benchmarks.

Also, should I add all benchmarks which were I commented on the

Yes, and there should be many different benchmarks for them like comparing different methods for the same operation e.g. the prem function vs the Poly.prem method vs the PolyElement.prem method etc:

In [1]: f, g = x**2*y + x*z + 1, x*z + y

In [2]: %time prem(f, g, x)
CPU times: user 13.2 ms, sys: 196 µs, total: 13.4 ms
Wall time: 12.3 ms
Out[2]: 
 3      2    2
y  - yz  + z 

In [3]: fp, gp = Poly(f, [x, y, z]), Poly(g, [x, y, z])

In [4]: %time fp.prem(gp)
CPU times: user 3.71 ms, sys: 0 ns, total: 3.71 ms
Wall time: 3.39 ms
Out[4]: Poly(y**3 - y*z**2 + z**2, x, y, z, domain='ZZ')

In [5]: R = ZZ[x,y,z]

In [6]: fpe, gpe = R.from_sympy(f), R.from_sympy(g)

In [7]: %time fpe.prem(gpe)
CPU times: user 1.86 ms, sys: 0 ns, total: 1.86 ms
Wall time: 1.88 ms
Out[7]: y**3 - y*z**2 + z**2

@1e9abhi1e10
Copy link
Contributor Author

1e9abhi1e10 commented Jul 14, 2023

Moving ahead should we also add benchmarks for the pdiv, pquo and pexquo?

@oscarbenjamin
Copy link
Contributor

Moving ahead should we also add benchmarks for the pdiv, pquo and pexquo?

Yes.

@oscarbenjamin
Copy link
Contributor

Moving ahead should we also add benchmarks for the pdiv, pquo and pexquo?

Yes.

Actually thinking about this we don't need benchmarks for pquo, pexquo and pdiv because they all use the same code (and that is unlikely to change in future). Just one of these is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants