Skip to content

perf: remove extra allocations in BLS point decoding#774

Open
sashass1315 wants to merge 1 commit intoa16z:masterfrom
sashass1315:perf/remove-bls-to-vec
Open

perf: remove extra allocations in BLS point decoding#774
sashass1315 wants to merge 1 commit intoa16z:masterfrom
sashass1315:perf/remove-bls-to-vec

Conversation

@sashass1315
Copy link
Copy Markdown

Previously, PublicKey::point and Signature::point converted the underlying FixedVector<u8, N> into a Vec<u8> on every call just to feed compressed bytes into G1Affine::from_compressed / G2Affine::from_compressed. This added unnecessary heap allocations and copies on the hot path of BLS signature verification. This change updates both helpers to borrow the bytes directly from the FixedVector via a slice and convert that slice into the fixed-size array expected by from_compressed, keeping behavior identical while eliminating the extra allocations.

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