-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DecodeAll
without checks
#556
Comments
(afk - on mobile, so short answer) I honestly don't think there will be much difference. Branches are predictable and there aren't really that many checks. The important part is allocations, which go away on the second uses. I don't really want potentially crashing code to be available. So a "probably no". Maybe if enabled by a build tag. |
Thank you for the answer. I fully understand you don't want an unsafe code. |
I have just checked the version without checks --- no significant changes were noticed in benchmarks. The biggest speedup is 1.05x, and some quite significant regressions |
Background: we may decode the same compressed data several times. Although it's possible the data is broken, then in such a case we won't try to decode it again.
I'm wondering if it would be possible to introduce a variant of decoding, where all sanity checks are not performed (like: if literals are big enough, if match length is within a range, and so on, so forth),
A client code would use it like this:
The text was updated successfully, but these errors were encountered: