cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Check Pedersen and Sqrt performance

Open pefontana opened this issue 1 year ago • 2 comments

We received a profiling report of the execution of some blocks, which indicates that Cairo native is spending a significant amount of time on Pedersen hashing and performing sqrt operations. profile001 First, we need to rerun several blocks to verify if we get the same results. In case it is true, it would be good to identify any low-hanging fruit to improve the performance of these operations.

pefontana avatar Sep 11 '24 18:09 pefontana

I run some benchmarks locally and got the same results (https://share.firefox.dev/47qLetx). Unfortunately, I couldn't find any possible optimizations to improve this.

I tried updating the pedersen dependency to see if that would improve it, but had no luck (#796).

It seems that pedersen is just a very expensive operation.

JulianGCalderon avatar Sep 16 '24 20:09 JulianGCalderon

It seems that pedersen is just a very expensive operation.

This has been the case for cairo-rs as well, so it checks out. That said, I believe we can improve sqrt on lambdaworks a little bit.

Oppen avatar Sep 23 '24 10:09 Oppen