Skip to content
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

Closed
sjakobi opened this issue Feb 15, 2017 · 7 comments
Closed

Speed up Store instances for (Byte)Strings of known size #3006

sjakobi opened this issue Feb 15, 2017 · 7 comments

Comments

@sjakobi
Copy link
Member

@sjakobi sjakobi commented Feb 15, 2017

Stack.Types.BuildPlan.GitSHA1 currently derives its Store 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! :)

@sjakobi
Copy link
Member Author

@sjakobi sjakobi commented Feb 20, 2017

If there isn't already a set of helpers for ByteStrings of known size in store, maybe it should be added! :)

See StaticSize.

@mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Feb 23, 2017

Yep, I think StaticSize is our answer to this, closing

@mgsloan mgsloan closed this Feb 23, 2017
@sjakobi
Copy link
Member Author

@sjakobi sjakobi commented Feb 24, 2017

Reopening, as stack's Store instances still need to make use of StaticSize, right?!

@sjakobi sjakobi reopened this Feb 24, 2017
@mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Feb 24, 2017

Oh, true! I thought this was on the store tracker.

@mgsloan mgsloan added this to the P3: Optional milestone Feb 24, 2017
alexeyzab added a commit to alexeyzab/stack that referenced this issue Apr 12, 2017
@alexeyzab
Copy link
Collaborator

@alexeyzab alexeyzab commented Apr 12, 2017

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!

snoyberg added a commit that referenced this issue Jul 17, 2017
@alexeyzab
Copy link
Collaborator

@alexeyzab alexeyzab commented Aug 22, 2017

I believe this can be closed.

@snoyberg
Copy link
Contributor

@snoyberg snoyberg commented Aug 22, 2017

Sounds good, thanks for catching that!

@snoyberg snoyberg closed this Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants