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

Comments

Projects
None yet
4 participants
@sjakobi
Contributor

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

Collaborator

mgsloan commented Feb 23, 2017

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

@mgsloan mgsloan closed this Feb 23, 2017

@sjakobi

This comment has been minimized.

Contributor

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

This comment has been minimized.

Collaborator

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

This comment has been minimized.

Collaborator

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

This comment has been minimized.

Collaborator

alexeyzab commented Aug 22, 2017

I believe this can be closed.

@snoyberg

This comment has been minimized.

Contributor

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