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