Skip to content

New Blake3 Optimization#136

Merged
lucidLuckylee merged 2 commits intoBitVM:mainfrom
FairgateLabs:blake3_optimization
Nov 26, 2024
Merged

New Blake3 Optimization#136
lucidLuckylee merged 2 commits intoBitVM:mainfrom
FairgateLabs:blake3_optimization

Conversation

@jonasmartin
Copy link
Copy Markdown
Contributor

I managed to further optimize the Blake3_u4 implementation (and fixed script size calculation).

  • The new size is 68.7kb instead of 75.6kb (about 9.5% improvement).
  • Stack consumption is slightly reduced, from 671 to 657.
  • This optimization requires updating rust-bitcoin-script-stack with a new PR that introduces a script optimizer.
  • One caveat: The stack needs to contain only the message before the script is called. Any additional elements must be moved to the alt-stack. That means an extra overhead of moving to and from the altstack, with that the result would still be under 70kb

@lucidLuckylee
Copy link
Copy Markdown
Contributor

Great improvement! Thank you for the PR.

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.

2 participants