Skip to content

Optimize various (de)serializations#19

Merged
fspreiss merged 41 commits intodfinity:mainfrom
research-ag:optimize-with-batching
Apr 21, 2026
Merged

Optimize various (de)serializations#19
fspreiss merged 41 commits intodfinity:mainfrom
research-ag:optimize-with-batching

Conversation

@timohanke
Copy link
Copy Markdown
Contributor

@timohanke timohanke commented Apr 16, 2026

  • Apply standard AI optimizations via skill file to entire codebase
  • Optimize Base58 encoding/decoding (almost 10x for the longest benchmark) via batching
  • Optimize Segwit encoding/decoding by avoiding List

This PR does not noticeably improve cryptographic operations. It is only useful for users who use the package for its (de)serialization functions (Bech32, Base58). A similar optimzation via batching had been recently done for Base64 in core.

This PR still has the bench.yml workflow inside it which commits benchmark.md in a GitHub action. We will remove it just before merging.

@timohanke timohanke requested a review from a team as a code owner April 16, 2026 19:52
fspreiss
fspreiss previously approved these changes Apr 21, 2026
Copy link
Copy Markdown
Contributor

@fspreiss fspreiss left a comment

Choose a reason for hiding this comment

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

Thanks for the optimizations!

Comment thread src/Base58.mo Outdated
Comment thread src/Segwit.mo Outdated
Comment thread src/ec/Jacobi.mo
@github-actions github-actions Bot dismissed fspreiss’s stale review April 21, 2026 15:35

Review dismissed by automation script.

@fspreiss fspreiss merged commit f204c56 into dfinity:main Apr 21, 2026
7 checks passed
@timohanke timohanke deleted the optimize-with-batching branch April 22, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants