Feat: Reduced operation via karatsuba multiplication algo - #6
Conversation
|
I benched the update and apparently Benched on Command: Before - After - I think it is probably due to many non-assign operations required for karatsuba multiplication. I think before going ahead with merging this, we shall figure out how to improve non-assign vector modular arithmetic operations. |
| pq_ctx.mul_assign(&mut c00, &c10); // r02 | ||
|
|
||
| let sum_r0r2 = pq_ctx.add(&c_r0, &c_r2); | ||
| pq_ctx.sub_assign(&mut c00, &sum_r0r2); // r00 |
There was a problem hiding this comment.
This way of implementation introduced an extra assignment and i think we can get rid of it.
Do you think this might hindering the performance ?
There was a problem hiding this comment.
I don't think replacing one add with 2 sub_assigns will make up for 4-5% in performance degradation. Just a reminder for me to look into vector modular operations to check what can be done.
Benchmark comparisons
Before Karatsuba Multiplication benchmark
After Karatsuba Multiplication benchmark