The benchmark executes 25% faster, time which could not be attribute to the speed of binary itself.
We use Cabal's PackageDescription as the type to serialize. It is large, has many levels of data types, and also uses enums and strings. It's a good stress test. GenericsBench defines criterion benchmarks for serialization and deserialization. In GenericsBenchTypes we derive the Binary instances. PackageDescription already defines Binary instances for the system installed Binary, but naturally this won't work for the benchmark - we need our own instances that are derived from the code in this library. The data to serialize we get from your .cabal/package/hackage.haskell.org/ directory, it's data from hackage, not autogenerated. GenericsBenchCache makes sure that if we rerun the benchmark we will use the same PackageDescriptions, even if the user has executed 'cabal update' since the last benchmark run.
Previously we had several non-allocating benchmarks. They were not representative to the most common use case where we want to save all the decoded input, not just a fraction. This patch updates the benchmark to save the decoded input in lists.
RULE: append flush flush = flush
This silences a GHC 7.10 warning that indicates that these modules are marked trustworthy when in fact they don't need to, since they are safe.
The two fields are unpacked, so this saves a couple of words per field until the Fingerprint value gets used.
The arbitrarySizedNatural creates too small Naturals so we didn't test all code paths. Use a custom generator to get bigger numbers.
Affects; - skip - getLazyByteString - getLazyByteStringNul - getRemainingLazyByteString These functions all read input chunks until some condition, reading enough bytes, reaching a NUL character, or it has consumed all bytes. They're now implemented by withInputChunks. This fixes a bug where the position in the input previously wasn't correctly reported if you ran out of input bytes. Tests have been added for getLazyByteString and skip to Action.hs. Tests for getLazyByteStringNul and getRemainingLazyByteString already exist in QC.hs.