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

Performance regression with ark 0.5 on deserializing PrimeField elements. #940

Open
dkales opened this issue Feb 18, 2025 · 0 comments
Open

Comments

@dkales
Copy link

dkales commented Feb 18, 2025

We recently upgraded to ark-* 0.5 and observed noticeable performance degradation on deserialization of large Vec<Primefield>.

This is due to the compiler no longer being able to optimize out the code in https://github.com/arkworks-rs/algebra/blob/48b5348e8998b927fe92f14bac348e0423e017b0/serialize/src/lib.rs#L65C1-L87C2, even though the check function is just Ok(()) for these.

Below is this new block in a flamegraph, this is completely missing when using ark-* 0.4.
Image

The init + teardown of the rayon call here is adding about 10x total runtime in our benchmarks, since we do quite a bit of serialization there (although I am fully aware that doing that many deserializations is probably not a common scenario).
Is this just left up to the compiler to optimize out and for some reason it no longer manages to do so? We can workaround it by disabling these checks completely, but we only would like to disable them for such cases anyway, which seems impossible to do without specialization.

Would be glad to hear any other ideas or workarounds.

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

1 participant