-
Notifications
You must be signed in to change notification settings - Fork 842
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
Speed up Store instances for (Byte)Strings of known size #3006
Comments
See |
Yep, I think |
Reopening, as stack's Store instances still need to make use of |
Oh, true! I thought this was on the store tracker. |
Hi there! I'd like to try implementing this. I'll be sending a PR shortly, let me know if I am on the right track. Thanks! |
I believe this can be closed. |
Sounds good, thanks for catching that! |
Stack.Types.BuildPlan.GitSHA1
currently derives itsStore
instance from the underlying ByteString, so store must assume a variable size. A handwritten instance could use the fact that a SHA1 digest has 20 bytes and would probably be a bit faster, and – depending on architecture – 4 or 8 bytes shorter.The same could be done for
Stack.Types.PackageIndex.PackageDownload.pdSHA256
and probably other types.If there isn't already a set of helpers for ByteStrings of known size in
store
, maybe it should be added! :)The text was updated successfully, but these errors were encountered: