-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce static libraries sizes #37
Comments
This is likely to be an issue for integration of RLN in js-waku (would be good to update this issue with wasm output once we have it). In the browser, a good size library is under 1MB. Looking at the current code organisation, I see a single crate for RLN. I am not totally familiar with wasm compilation. I don't know if you could only compile "some" of the API but I do know that you usually have to create a wasm API that then use the Rust API (similar to react native). When starting the JS/wasm code, it would be good to split the wasm API in scoped functionality: generate credentials, generate proof, verify proof so that it is possible to generate a wasm blob that can generate credentials and generate proof but not unnecessary "verify proof" code. We probably want to go toward a flexible road so that an app developer can decide whether to:
Depending on how big the wasm blob is (ie, unusable in the browser) then this issue may need to be prioritised before the optimisation phase. Note: added to RAID for Waku Product. |
WIP: I was able to reduce the size, e.g. for
do you expect the whole RLN |
These are great news! Awesome job, @s1fr0! |
Ultimately yes, but this would go under the optimization effort for an optimal browser experience. Not too worry about right now. |
I self-assigned this issue to me, since I'm working on reducing more libraries sizes. |
Let us know if we can trim any deps on the ethers side, or introduce any features which let you further customize what you pull in! |
@richard-ramos Could you please, take a look at this diff diff_with_our_fork to make sure that all the changes here are needed (especially the |
Supportive of all changes that can make Ark Circom less heavy, appreciate your guys' help here. |
@rahulghangas @rymnc what do you think of this issue #135 regarding the overall context? |
As long as no compilation issues come up, sounds good to me |
The [lib] part i think it was me doing some experiments and it's not really needed as we're not using ark-circom as a dynamic library. The other changes ( |
As we are now using |
I agree that it can be closed for now, @rymnc thoughts? |
Agreed. there may be some further optimizations we can do over time, but let's close this and open a specific issue later |
Problem
While attempting to implement go-rln-zerokit, I noticed that the resulting static libraries size are very large compared to kilic/rln:
⁃ aarch64-apple-darwin: 21.9MB
⁃ x86_64-apple-darwin: 22.6MB
⁃ aarch64-apple-ios: 21.8MB
⁃ x86_64-apple-ios: 22.6MB
⁃ universal (supporting
aarch64-apple-ios,x86_64-apple-ios
): 44.4MB⁃ aarch64-apple-darwin: 57.7MB
⁃ x86_64-apple-darwin: 59.5MB
⁃ aarch64-apple-ios: 152MB
⁃ x86_64-apple-ios: 60.5MB
⁃ universal (supporting
aarch64-apple-ios,x86_64-apple-ios
): 212.5MBWhile this is not an issue for desktop architecture, it is certainly not nice to have an app size increase due to the libraries it uses (also, I find it interesting that aarch64-apple-ios is 152MB, compared to the 60.5MB of x86_64-apple-ios).
I used the following commands to generate the static libs.
Acceptance criteria
The text was updated successfully, but these errors were encountered: