Skip to content

Conversation

@richardpringle
Copy link
Contributor

@richardpringle richardpringle commented Apr 7, 2025

Applying MinaProtocol/mina#16775 to proof-systems since the code moved

Manually allocating can potentially side-step a compiler optimization of re-using previous allocations where possible. Also, it's not a good practive to pass in a Vec to a function where all you do with the Vec is call as_slice. A Vec consists of a pointer, a length, and a capacity whereas a slice is only a pointer and a length. Slices should always be prefered when elements aren't being added or removed.

We were manually creating vectors instead of using iterators and
collect in the wasm code. This code should be more efficient
@richardpringle richardpringle self-assigned this Apr 7, 2025
@richardpringle richardpringle changed the title Don't pass around unnecessary vectors [plonk_wasm] Don't pass around unnecessary vectors Apr 7, 2025
@dannywillems
Copy link
Member

dannywillems commented Apr 8, 2025

Waiting for #3157 to get merged to follow-up on this one. I'd like to be sure it does not break o1js.

@richardpringle
Copy link
Contributor Author

Update:
This is still relevant but requires a little thought to apply to the latest changes (there's a from_bytes method that exists now that should probably be replaced).

I will get back to this when I have a chance, but please don't close in the meantime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants