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 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 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 commented Feb 23, 2017

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

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

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 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

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!

@alexeyzab
Copy link
Collaborator

I believe this can be closed.

@snoyberg
Copy link
Contributor

Sounds good, thanks for catching that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants