Skip to content

perf: Make PublicKey decoding lazy inside WASM#5048

Merged
dima74 merged 2 commits intohyperledger-iroha:mainfrom
dima74:diralik/wasm-lazy-decoding-PublicKey
Sep 13, 2024
Merged

perf: Make PublicKey decoding lazy inside WASM#5048
dima74 merged 2 commits intohyperledger-iroha:mainfrom
dima74:diralik/wasm-lazy-decoding-PublicKey

Conversation

@dima74
Copy link
Copy Markdown
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
Comment thread crypto/src/lib.rs Outdated
@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
Comment thread crypto/src/lib.rs
@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
Copy Markdown
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
@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
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.

Lazy deserialization for PublicKey inside WASM

4 participants