Skip to content

Faster update twiddles function in whir crate#225

Open
vladfdp wants to merge 3 commits into
leanEthereum:mainfrom
vladfdp:perf/faster-update-twiddles
Open

Faster update twiddles function in whir crate#225
vladfdp wants to merge 3 commits into
leanEthereum:mainfrom
vladfdp:perf/faster-update-twiddles

Conversation

@vladfdp
Copy link
Copy Markdown

@vladfdp vladfdp commented May 15, 2026

Did the TODO in [dft.rs](http://dft.rs) of the whir crate.
instead of recomputing everything we reuse the existing twiddles.
Here are benchmarks run in release mode comparing the new function to the old one.
The speedup is significant but drops down with the ratio of new to old twiddles size

start        target       update_twiddles     update_new    speedup
2^8          2^9                 1.816µs          537ns      3.38x (2x growth)
2^8          2^10                3.062µs        1.414µs      2.17x (4x growth)
2^8          2^11                7.926µs        3.295µs      2.41x (8x growth)
2^8          2^12               14.193µs        7.358µs      1.93x (16x growth)
2^12         2^13               25.152µs        7.051µs      3.57x (2x growth)
2^12         2^14               46.344µs       15.242µs      3.04x (4x growth)
2^12         2^15               86.562µs       35.265µs      2.45x (8x growth)
2^12         2^16              162.497µs       90.329µs      1.80x (16x growth)
2^16         2^17              328.373µs        97.45µs      3.37x (2x growth)
2^16         2^18              653.316µs      218.411µs      2.99x (4x growth)
2^16         2^19             1.298278ms      544.642µs      2.38x (8x growth)
2^16         2^20             2.603312ms     1.416323ms      1.84x (16x growth)

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