The current approach to allow usage of the Sonobe's Circom frontend in the browser, takes the Circom's generated 'witness_generator' wasm and it 'simulates' it within wasm (compiled from rust). This 'wasm inception' of 1 level seems to be a bit costly, which results into folding steps being considerably slow (~10s per step, using Circom frontend in the browser).
The Circom witness generation outputs a wasm file that can be directly executed in the browser to generate the witness fast (without interpreting it inside another wasm), ideally we would not be simulating wasm inside another wasm but directly using the wasm from circom called from js, and passing the result of this computation to the wasm compilation of sonobe, which should be faster than the current approach.
Notice that this only affects the Sonobe's Circom frontend used in the browser.
The current approach to allow usage of the Sonobe's Circom frontend in the browser, takes the Circom's generated 'witness_generator' wasm and it 'simulates' it within wasm (compiled from rust). This 'wasm inception' of 1 level seems to be a bit costly, which results into folding steps being considerably slow (~10s per step, using Circom frontend in the browser).
The Circom witness generation outputs a wasm file that can be directly executed in the browser to generate the witness fast (without interpreting it inside another wasm), ideally we would not be simulating wasm inside another wasm but directly using the wasm from circom called from js, and passing the result of this computation to the wasm compilation of sonobe, which should be faster than the current approach.
Notice that this only affects the Sonobe's Circom frontend used in the browser.