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

feat: support hashtree sha256 lib #172

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

estensen
Copy link

@estensen estensen commented Dec 7, 2024

Stacked on #169

Just enabling feature flags give much better perf. Step towards #156 but more optimizations possible as mentioned in #161 (comment). But I don't think lack of vectorized/parallel pipelining should prevent this from being merged. This is a major step towards getting this library performant enough so it can be used.

default sha256

sudo cargo bench --bench compute_proof && sudo cargo bench --bench compute_proof
...
Prove Benchmark - File: benches/21315748.json - size 247/123
                        time:   [153.78 ms 155.64 ms 156.80 ms]
                        change: [-1.7347% -0.5531% +0.6920%] (p = 0.42 > 0.05)
                        No change in performance detected.

Prove Benchmark - File: benches/21327802.json - size 261/130
                        time:   [155.16 ms 156.10 ms 156.81 ms]
                        change: [-1.5089% -0.5273% +0.8751%] (p = 0.46 > 0.05)
                        No change in performance detected.

sha256-asm feature flag enabled

sudo cargo bench --bench compute_proof && sudo cargo bench --bench compute_proof --features sha256-asm
...
Prove Benchmark - File: benches/21315748.json - size 247/123
                        time:   [56.672 ms 57.170 ms 57.664 ms]
                        change: [-63.290% -62.915% -62.534%] (p = 0.00 < 0.05)
                        Performance has improved.

Prove Benchmark - File: benches/21327802.json - size 261/130
                        time:   [57.677 ms 58.089 ms 58.523 ms]
                        change: [-63.573% -63.007% -62.541%] (p = 0.00 < 0.05)
                        Performance has improved.

hashtree

sudo cargo bench --bench compute_proof && sudo cargo bench --bench compute_proof --features hashtree
...
Prove Benchmark - File: benches/21315748.json - size 247/123
                        time:   [48.933 ms 50.096 ms 51.119 ms]
                        change: [-15.087% -13.401% -11.414%] (p = 0.00 < 0.05)
                        Performance has improved.

Prove Benchmark - File: benches/21327802.json - size 261/130
                        time:   [48.718 ms 49.614 ms 51.459 ms]
                        change: [-13.992% -11.575% -8.9135%] (p = 0.00 < 0.05)
                        Performance has improved.

@estensen estensen marked this pull request as ready for review December 7, 2024 13:46
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

Successfully merging this pull request may close these issues.

1 participant