KACTL ModMul. It says that it runs around 2x faster than naive
(__int128_t)a * b % M
When I ran my benchmarks with -O2, the results were similar. Am I mistaken?
# | User | Rating |
---|---|---|
1 | tourist | 3803 |
2 | jiangly | 3707 |
3 | Benq | 3627 |
4 | ecnerwala | 3584 |
5 | orzdevinwang | 3573 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | Radewoosh | 3542 |
9 | jqdai0815 | 3532 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 170 |
2 | awoo | 164 |
3 | adamant | 162 |
4 | maroonrk | 152 |
5 | -is-this-fft- | 151 |
6 | nor | 150 |
7 | atcoder_official | 148 |
7 | SecondThread | 148 |
9 | TheScrasse | 146 |
10 | Petr | 145 |
KACTL ModMul. It says that it runs around 2x faster than naive
(__int128_t)a * b % M
When I ran my benchmarks with -O2, the results were similar. Am I mistaken?
Name |
---|
This is only one mod operation, try doing more operations and benchmarking.
I did that. I did 1e5 runs and their running time was basically the same.
1e5 operations is not very many. That should take around 1 millisecond. Try something like 1e10 of them to spot a consistent difference. Also make sure the compiler can't optimize it out.