Skip to content

Speed optimizations for poseidon2_goldilocks_plonky2 and field.#34

Open
Mychecksdead wants to merge 13 commits intomainfrom
speed-optimizations
Open

Speed optimizations for poseidon2_goldilocks_plonky2 and field.#34
Mychecksdead wants to merge 13 commits intomainfrom
speed-optimizations

Conversation

@Mychecksdead
Copy link

@Mychecksdead Mychecksdead commented Mar 22, 2026

Speed + memory optimizations.

Speed:

  • Removed branchHints as they aren't working.
  • Manually inlined MulAccF.
  • Some changes to externalLayer function (reordering of calculations, manual inlining).

Memory:

  • Created HashNToMNoPadBytesOptimized. This new function assumes a 32-byte output array as parameter.

  • Similarly updated Sum function.

  • Directly used bits.LittleEndian.PutUint64 function to avoid make() inside ToLittleEndianBytes.

  • Added tests.

  • Simple changes in uint128 for simplicity.

@Mychecksdead Mychecksdead marked this pull request as ready for review March 23, 2026 11:41
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.

1 participant