Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

perf: Make PublicKey decoding lazy inside WASM #5048

Merged

Conversation

dima74
Copy link
Contributor

@dima74 dima74 commented Sep 9, 2024

Context

Fixes #5038

Solution

Make PublicKey decoding lazy inside WASM, since PublicKey in WASM is used mostly for comparison operations (==), and comparison can be performed without decoding (see #5038 for details). This givess approximatelly 400tps increase for single peer (from ~2450 to ~2850).

Review notes (optional)

Checklist

  • I've read CONTRIBUTING.md.
  • (optional) I've written unit tests for the code changes.
  • All review comments have been resolved.
  • All CI checks pass.

@dima74 dima74 self-assigned this Sep 9, 2024
@dima74 dima74 force-pushed the diralik/wasm-lazy-decoding-PublicKey branch from a2e9088 to 66b7494 Compare September 9, 2024 14:48
crypto/src/lib.rs Outdated Show resolved Hide resolved
@DCNick3 DCNick3 self-assigned this Sep 9, 2024
@dima74 dima74 force-pushed the diralik/wasm-lazy-decoding-PublicKey branch from 66b7494 to 2c799e1 Compare September 10, 2024 15:04
DCNick3
DCNick3 previously approved these changes Sep 10, 2024
@Erigara Erigara self-assigned this Sep 11, 2024
crypto/src/lib.rs Outdated Show resolved Hide resolved
@dima74 dima74 force-pushed the diralik/wasm-lazy-decoding-PublicKey branch from 2c799e1 to b81435c Compare September 11, 2024 10:59
Erigara
Erigara previously approved these changes Sep 12, 2024
DCNick3
DCNick3 previously approved these changes Sep 12, 2024
@dima74 dima74 force-pushed the diralik/wasm-lazy-decoding-PublicKey branch 2 times, most recently from 7e06caa to b9b4757 Compare September 12, 2024 13:12
Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
@nxsaken nxsaken force-pushed the diralik/wasm-lazy-decoding-PublicKey branch from b9b4757 to ad6fb9d Compare September 12, 2024 13:53
Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
@dima74 dima74 dismissed stale reviews from Erigara and DCNick3 via b439934 September 12, 2024 15:32
@dima74
Copy link
Contributor Author

dima74 commented Sep 12, 2024

Looks like this PR would fail I2::Dev::Wasm workflow. Please review latest commit with the fix

@dima74 dima74 merged commit cdf7dd7 into hyperledger-iroha:main Sep 13, 2024
16 of 18 checks passed
@dima74 dima74 deleted the diralik/wasm-lazy-decoding-PublicKey branch September 13, 2024 08:15
@dima74 dima74 mentioned this pull request Sep 13, 2024
5 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lazy deserialization for PublicKey inside WASM
4 participants