Skip to content

Optimize JSI to ByteBuffer conversion in RevocationRegistry #8

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

Conversation

AhmedFatthy1040
Copy link
Contributor

Added direct JSI to ByteBuffer conversion by implementing jsiToValue<ByteBuffer>, eliminating the intermediate string conversion step. Applied this optimization to revocationRegistryFromJson as specified in issue hyperledger/anoncreds-rs#176. This makes the code cleaner and more efficient by reducing unnecessary memory allocations.

@swcurran
Copy link
Member

@andrewwhitehead — can you please take a look and approve? Looks fine to me, but I’m not knowledgeable enough in the code.

@swcurran
Copy link
Member

Actually, it should be @berendsliedrecht or @TimoGlastra that takes a look, pretty please.

@swcurran swcurran requested review from genaris and TimoGlastra April 16, 2025 13:56
Copy link
Contributor

@berendsliedrecht berendsliedrecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been tested in the React Native example app? Can you add a screenshot?

@AhmedFatthy1040
Copy link
Contributor Author

AhmedFatthy1040 commented Apr 17, 2025

@swcurran @berendsliedrecht Thanks for your review! I actually built the code, and it compiled successfully without any errors. I tried the React Native example as you suggested, but I noticed that it only uses anoncreds.version(). So I'm not sure if that's enough to properly test the revocationRegistryFromJson function.

Here are the screenshots:
Screenshot (83)
Screenshot (82)

@berendsliedrecht
Copy link
Contributor

@AhmedFatthy1040 Thanks! Did you check all the places where it could be replaced? Or was it only the revregdeffromjson?

Re the version 0.2.0, thats fine. It is mainly a test to see that everything compiled correctly.

@AhmedFatthy1040 AhmedFatthy1040 force-pushed the fix-176-bytebuffer-optimization branch from 532055d to aea1db7 Compare April 17, 2025 14:49
@AhmedFatthy1040
Copy link
Contributor Author

AhmedFatthy1040 commented Apr 17, 2025

@berendsliedrecht I've now checked all the functions in similar situations and handled them as well. After making the changes, I tested the app and it compiled successfully.

@berendsliedrecht
Copy link
Contributor

Thanks for the PR @AhmedFatthy1040

@berendsliedrecht berendsliedrecht merged commit 2d542db into hyperledger:main Apr 18, 2025
2 checks passed
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