privacy-scaling-explorations / sonobe

Experimental folding schemes library
https://privacy-scaling-explorations.github.io/sonobe-docs/
MIT License
204 stars 53 forks source link

automate profiling & reduce memory usage #140

Open arnaucube opened 3 months ago

arnaucube commented 3 months ago

I've been trying to use Nova to fold Circom & arkworks circuits in this repo: https://github.com/arnaucube/hash-chain-sonobe and specially when folding arkworks circuits, the memory usage keeps growing while the prove_step is being called over and over.

I've started to update Sonobe removing a bunch of .clone()s and removed the usage of Vec<_> along the nova.prove_step method in the branch https://github.com/privacy-scaling-explorations/sonobe/tree/reduce-memory-usage, but more work needs to be done on it.

To test it, there is a branch in the hash-chain-sonobe repo that uses the reduce-memory-usage branch of sonobe: https://github.com/arnaucube/hash-chain-sonobe/tree/reduce-memory-usage , since the interfaces have changed in sonobe's branch.

The task of this issue would be:

  1. Automating the usage of profiling tools of the memory usage, so that we can be aware of the concrete improvements (for this time but also for the future)
  2. Reduce memory usage, specially focusing on the .prove_step() method