Skip to content

Commit dbe2cc6

Browse files
authored
Faster u32 parsing (#428)
This way removes a separate `State::Signature` variant and handles the PNG signature via two `State::U32` states. This is desirable because: * This helps to reuse the performance gains for `State::U32` (i.e. avoid accumulating the signature byte-by-byte if the input buffer already has all its bytes) * Avoiding separate code also has additional benefits: - Less pressure on the instructions cache - Ability to reuse branch prediction for `U32`-related code The modified code already has reasonable test coverage via http://www.schaik.com/pngsuite/#corrupted
1 parent badce2a commit dbe2cc6

File tree

1 file changed

+209
-155
lines changed

1 file changed

+209
-155
lines changed

0 commit comments

Comments
 (0)