perf: optimize transaction, BEEF, and Toolbox pipelines#285
Open
ty-everett wants to merge 1 commit into
Open
Conversation
a1e53e4 to
5a12b0d
Compare
3c72174 to
9fb1cc2
Compare
9fb1cc2 to
29ae61e
Compare
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Implements the transaction-performance items 2–6 across
@bsv/sdkand Wallet Toolbox:Transaction.toBEEFUint8Array()while preserving its runtimenumber[]behavior, and addsTransaction.toBEEFBytes()as the correct typed replacement;createAction/signAction/internalization, keeps typed bytes through persistence boundaries, and removes redundant parsing/allocation;This prepares
@bsv/sdk2.1.8 and the Node/client/mobile Toolbox packages in lockstep at 2.4.2.Compatibility and correctness
fromBinaryremains copy-safe; zero-copy behavior is opt-in through explicit*ViewAPIs with documented caller immutability requirements.toBEEFUint8Array()runtime shape is deliberately unchanged to avoid a breaking change.Retained-baseline benchmarks
Apple Silicon, Node.js v25.9.0, identical generated workloads and benchmark code:
mainA representative 1 MiB binary RPC value drops from 3,743,755 JSON bytes to 1,398,147 bytes (62.7% smaller). The optimized default 2,000-link/4.24 MB pipeline completes the measured serialize/parse/link/verify/sort stages in about 69 ms;
mainoverflows the JavaScript stack at that depth. The branch has an automated 3,000-link regression.Reproduction commands and full measurements are in
packages/sdk/docs/performance.md.Validation
@bsv/sdkbuild (ESM/CJS/types/UMD): passStorageClientintegrationts-standardpasspnpm check-versions: passgit diff --check: passnpm pack --dry-run: passmainand branch buildsThe repository-wide SDK lint target still reports pre-existing errors in unrelated identity, KV-store, overlay, BigNumber, and script-error files; every file changed here passes the same linter. The full Toolbox suite now includes and passes
StorageClient.test.ts; this caught and verified the AuthFetch-intercepted response-header fix in addition to the deterministic Node, browser, and mobile codec tests.