Skip to content

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

@sjakobi

Description

@sjakobi

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! :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions