Skip to content

perf: make SetBytes not allocate errors in non-fast path#599

Merged
gbotrel merged 1 commit intomasterfrom
perf/errstatic
Jan 14, 2025
Merged

perf: make SetBytes not allocate errors in non-fast path#599
gbotrel merged 1 commit intomasterfrom
perf/errstatic

Conversation

@gbotrel
Copy link
Copy Markdown
Collaborator

@gbotrel gbotrel commented Jan 11, 2025

Description

Noticed a minor issue when benchmark memory allocations in some gnark-crypto upstream code; calling many SetBytes() that are larger than modulus, would result in bigEndian.Element calling errors.New(...) and allocating new error objects at each call. Not needed obviously.

@gbotrel gbotrel requested review from Tabaie and yelhousni January 11, 2025 03:34
@gbotrel gbotrel merged commit 5e3e49f into master Jan 14, 2025
@gbotrel gbotrel deleted the perf/errstatic branch January 14, 2025 14:59
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