Skip to content

Another Round of Inlining Optimizations - Poseidon2 - #36

Merged
Mychecksdead merged 12 commits into
mainfrom
inlining-optz
Jul 7, 2026
Merged

Mychecksdead merged 12 commits into
mainfrom
inlining-optz

Conversation

@Mychecksdead

@Mychecksdead Mychecksdead commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

37.5% faster than before.

Ready for review

I checked out the arithmetic and it seems fine. Also run on a bunch of tests, but still I will run a multi-hour fuzz+random test.

Update:

  • Run 6 hours of random and fuzz tests, all passing.

  • Run on end to end tests, all passing.

  • Now this PR also includes signature verification speed up.

@Mychecksdead
Mychecksdead requested a review from lighterb June 10, 2026 23:46
Signature verification went down from 290 microseconds to 130~
(combining with #36). (ECgFp5Point's was using lot of divisions, and
there weren't any other way to calculate it other than Fermat, which was
taking lot of field operations.)

After #36, it was 235 microseconds.

- Main optimization is passing to AffinePoints for Verification (this
brought it down to 175).
- Precomputing the generator's affine windows also helped another 10-15
microseconds.
- Delaying carries did the last 30 microseconds.

There is probably a bit more room, maybe 10%~.

@eminayar eminayar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, would be nice if someone else also takes a look though

@Mychecksdead
Mychecksdead merged commit ca0ad1b into main Jul 7, 2026
5 checks passed
@Mychecksdead
Mychecksdead deleted the inlining-optz branch July 7, 2026 07:25
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