Improve performance of digest64
Nobody has claimed this yet.
- #359 by @twoeths — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- performance
Research direction
Start by locating digest64, digestTwoHashObjects, digest, and hashBlocks() in the TypeScript implementation, then run the existing digest benchmarks locally and compare them with CI results. Investigate the listed assemblyscript, hashBlocks() chaining, and Uint8Array.slice() ideas separately; done means a verified performance improvement that does not reproduce the CI regression.
Written by the indexing model from the issue text.
Description
Some improvement could be done:
- Use latest assemblyscript yields better performance
- Chain w computation to the main loop in hashBlocks()
- Return result by using Uint8Array.slice()
digestTwoHashObjects vs digest64 vs digest
✓ digestTwoHashObjects 50023 times 19.25844 ops/s 51.92528 ms/op - 67 runs 3.98 s
✓ digest64 50023 times 20.23583 ops/s 49.41730 ms/op - 12 runs 1.11 s
✓ digest 50023 times 20.31116 ops/s 49.23402 ms/op - 13 runs 1.19 s
this branch
digestTwoHashObjects vs digest64 vs digest
✓ digestTwoHashObjects 50023 times 21.91978 ops/s 45.62089 ms/op - 1304 runs 60.0 s
✓ digest64 50023 times 21.11148 ops/s 47.36759 ms/op - 1256 runs 60.0 s
✓ digest 50023 times 20.90464 ops/s 47.83628 ms/op - 1244 runs 60.0 s
however benchmark result in CI consistently shows worse statistics so need to investigate this, may need to separate to smaller PRs in order to figure out the issue
Originally posted by @tuyennhv in https://github.com/ChainSafe/ssz/issues/347#issuecomment-1972804385
- Dominant language
- TypeScript
- Stars
- 62
- Forks
- 27
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChainSafe/ssz
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
SSZ Union Deserialization Vulnerable to Trailing Data for Certain VariantsPossibly taken @shadowzzed claimed this 41 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Similar issues
-
check:failed streams:edit
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
iptv-org/iptv#55901 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
package:ios ships XCFrameworks with absolute symlinks, which SwiftPM refuses to extractPossibly taken @cusnirvladislav claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/rock#740 ·
-
S: triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
area:workflow bug ready-for-human
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fil-donadoni/tolaria#6108 ·
Maintainers usually reply within 1 day