packages/binary.git
3 years agoMerge pull request #116 from bgamari/inline-tuple-instances
Lennart Kolmodin [Wed, 25 May 2016 19:40:33 +0000 (21:40 +0200)] 
Merge pull request #116 from bgamari/inline-tuple-instances

Ensure that Binary instances for tuples are inlined

3 years agoUpdate generics-bench to use Cabal == 1.24.*
Lennart Kolmodin [Wed, 25 May 2016 19:04:05 +0000 (21:04 +0200)] 
Update generics-bench to use Cabal == 1.24.*

3 years agoEnsure that Binary instances for tuples are inlined
Ben Gamari [Sun, 15 May 2016 21:54:02 +0000 (23:54 +0200)] 
Ensure that Binary instances for tuples are inlined

Otherwise we end up relying on dynamic dispatch here which has a rather
drastic effect on runtime.

3 years agoAdd ghc-prim dependency to all targets.
Lennart Kolmodin [Sun, 1 May 2016 09:19:58 +0000 (11:19 +0200)] 
Add ghc-prim dependency to all targets.

Now that Generics is used in all targets, we also need ghc-prim.

3 years agoReenable GHC 7.4.2 on Travis CI
Lennart Kolmodin [Sun, 1 May 2016 09:07:47 +0000 (11:07 +0200)] 
Reenable GHC 7.4.2 on Travis CI

The dependency problem should have been fixed now.
See haskell/tar#15.

3 years agoRemove old CPP
Lennart Kolmodin [Sun, 1 May 2016 09:05:19 +0000 (11:05 +0200)] 
Remove old CPP

This CPP is no longer needed now that we only support GHC >= 7.4.

3 years agoRequire GHC>=7.4.1.
Lennart Kolmodin [Sat, 30 Apr 2016 21:34:43 +0000 (23:34 +0200)] 
Require GHC>=7.4.1.

3 years agoBump version to 0.8.3.0. 0.8.3.0
Lennart Kolmodin [Tue, 19 Apr 2016 19:00:14 +0000 (21:00 +0200)] 
Bump version to 0.8.3.0.

Next version won't be 0.9.0.0 as previously stated. Looks like no changes
should be breaking, except for the semi public API in
Data.Binary.Builder.Internal which now has been removed.

Also remove GHC 7.6.3 from 'tested-with'. It was removed from Travis CI since
its dependencies doesn't build.

3 years agoRemove Num constraint.
Lennart Kolmodin [Tue, 19 Apr 2016 16:12:09 +0000 (18:12 +0200)] 
Remove Num constraint.

It wasn't required.

3 years agoFix typo.
Lennart Kolmodin [Tue, 19 Apr 2016 15:42:34 +0000 (17:42 +0200)] 
Fix typo.

3 years agoFix compilation error on GHC < 8.
Lennart Kolmodin [Tue, 19 Apr 2016 15:28:56 +0000 (17:28 +0200)] 
Fix compilation error on GHC < 8.

3 years agoRemove Eq constraint.
Lennart Kolmodin [Tue, 19 Apr 2016 05:39:14 +0000 (07:39 +0200)] 
Remove Eq constraint.

It wasn't required.

3 years agoAdd Semigroup for Put for GHC 8.
Lennart Kolmodin [Tue, 19 Apr 2016 05:37:05 +0000 (07:37 +0200)] 
Add Semigroup for Put for GHC 8.

base-4.9.0.0 has Data.Semigroup.

3 years agoAdd Double to Put benchmark.
Lennart Kolmodin [Sat, 16 Apr 2016 21:44:53 +0000 (23:44 +0200)] 
Add Double to Put benchmark.

3 years agoUse monoid in Put benchmark.
Lennart Kolmodin [Sat, 16 Apr 2016 10:41:05 +0000 (12:41 +0200)] 
Use monoid in Put benchmark.

3 years agoImplement put in Binary instances only using monoid.
Lennart Kolmodin [Sat, 16 Apr 2016 10:17:56 +0000 (12:17 +0200)] 
Implement put in Binary instances only using monoid.

3 years agoRewrite mappend to only depend on the Builders.
Lennart Kolmodin [Sat, 16 Apr 2016 08:04:47 +0000 (10:04 +0200)] 
Rewrite mappend to only depend on the Builders.

This gives a 5% speedup in the generics-bench benchmark.

3 years agoUse ghc 7.10.3 on travis CI instead of ghc 7.10.2.
Lennart Kolmodin [Fri, 15 Apr 2016 20:27:07 +0000 (22:27 +0200)] 
Use ghc 7.10.3 on travis CI instead of ghc 7.10.2.

3 years agoRemove ghc 7.4.2 from travis CI.
Lennart Kolmodin [Fri, 15 Apr 2016 20:24:13 +0000 (22:24 +0200)] 
Remove ghc 7.4.2 from travis CI.

It's been failing on travis for 3 months due to failing dependencies.

3 years agoUpdate changelog for version 0.9.0.0.
Lennart Kolmodin [Wed, 13 Apr 2016 18:31:26 +0000 (20:31 +0200)] 
Update changelog for version 0.9.0.0.

3 years agoFix compilation error for GHC < 7.10.
Lennart Kolmodin [Tue, 12 Apr 2016 20:03:34 +0000 (22:03 +0200)] 
Fix compilation error for GHC < 7.10.

3 years agoSilence warning.
Lennart Kolmodin [Mon, 11 Apr 2016 20:14:45 +0000 (22:14 +0200)] 
Silence warning.

3 years agoAdd small Generics bench to the Put benchmark suite.
Lennart Kolmodin [Mon, 11 Apr 2016 20:03:58 +0000 (22:03 +0200)] 
Add small Generics bench to the Put benchmark suite.

3 years agoExplicitly test small and big Integers and Naturals.
Lennart Kolmodin [Sun, 10 Apr 2016 10:14:55 +0000 (12:14 +0200)] 
Explicitly test small and big Integers and Naturals.

3 years agoCompare Put with Data.ByteString.Builder in put benchmark.
Lennart Kolmodin [Sat, 9 Apr 2016 11:41:57 +0000 (13:41 +0200)] 
Compare Put with Data.ByteString.Builder in put benchmark.

3 years agoMerge pull request #112 from jystic/topic/put-monoid
Lennart Kolmodin [Sat, 9 Apr 2016 08:41:19 +0000 (10:41 +0200)] 
Merge pull request #112 from jystic/topic/put-monoid

Add Monoid instance for Put

3 years agoAdd Monoid instance for Put
Jacob Stanley [Sat, 9 Apr 2016 06:45:56 +0000 (16:45 +1000)] 
Add Monoid instance for Put

3 years agoTest list of values for Natural and GHC.Fingerprint.
Lennart Kolmodin [Fri, 8 Apr 2016 21:10:42 +0000 (23:10 +0200)] 
Test list of values for Natural and GHC.Fingerprint.

3 years agoWhen QCing the Binary class, also test a list of values.
Lennart Kolmodin [Thu, 7 Apr 2016 19:34:58 +0000 (21:34 +0200)] 
When QCing the Binary class, also test a list of values.

Now that we have 'putList' in Binary we must take care that we test
reading/writing with lists too. This patch makes sure that we always test
reading/writing list values when we test single values.

3 years agoAdd 'putList' for all IntXX and WordXX.
Lennart Kolmodin [Thu, 7 Apr 2016 19:27:38 +0000 (21:27 +0200)] 
Add 'putList' for all IntXX and WordXX.

3 years agoAdd 'putList' instance for Word8.
Lennart Kolmodin [Mon, 4 Apr 2016 20:31:03 +0000 (22:31 +0200)] 
Add 'putList' instance for Word8.

Highlights from the benchmarks;
  "big Integers"                                         :      5850.12 us        3841.54 us      -34.3%
  "[big Integer]"                                        :      6074.67 us        3959.01 us      -34.8%
  Word8s                                                 :       256.19 us         266.92 us      +4.2%
  [Word8]                                                :       283.39 us          67.59 us      -76.2%

3 years agoDocument 'putList'.
Lennart Kolmodin [Sun, 3 Apr 2016 20:23:55 +0000 (22:23 +0200)] 
Document 'putList'.

3 years agoAdd new benchmark suite for encoding.
Lennart Kolmodin [Sun, 3 Apr 2016 20:17:05 +0000 (22:17 +0200)] 
Add new benchmark suite for encoding.

3 years agoMerge branch 'pr/bytestring-builder'
Lennart Kolmodin [Sun, 3 Apr 2016 20:14:42 +0000 (22:14 +0200)] 
Merge branch 'pr/bytestring-builder'

3 years agoAdd 'putList' instance for Char.
Lennart Kolmodin [Sun, 3 Apr 2016 20:03:00 +0000 (22:03 +0200)] 
Add 'putList' instance for Char.

This speeds up the UTF8 encoding of String with about 70%.

The small String benchmark;
  "small Strings"  :      3459.04 us        1037.00 us      -70.0%

GenericsBench bechmark encodes a data type with many Strings;
  encode           :     46391.59 us       13116.85 us      -71.7%

3 years agoExtend the Binary class with 'putList :: [a] -> Put'
Lennart Kolmodin [Sun, 3 Apr 2016 18:09:36 +0000 (20:09 +0200)] 
Extend the Binary class with 'putList :: [a] -> Put'

The default implementation of the new class function is the same as
'instance Binary a => Binary [a]' used to be.

'putList' will enable users to define their own serialization for lists of
types. We'll use this to give new list serialization implementations for types
already defined in binary.

3 years agoUse putCharUtf8 from Builder in 'instance Binary Char'.
Lennart Kolmodin [Sat, 2 Apr 2016 07:24:23 +0000 (09:24 +0200)] 
Use putCharUtf8 from Builder in 'instance Binary Char'.

Using `Data.ByteString.Builder` made GenericsBench.encode 10% slower. This
brings it back to the same numbers as before.

3 years agoMove to bytestring Builder
Ben Gamari [Wed, 14 Jan 2015 23:14:50 +0000 (18:14 -0500)] 
Move to bytestring Builder

3 years agoMerge pull request #110 from sid-kap/complex_instance
Lennart Kolmodin [Sat, 26 Mar 2016 07:45:31 +0000 (08:45 +0100)] 
Merge pull request #110 from sid-kap/complex_instance

Add Binary instance for Complex a

3 years agoAdd Binary instance for Complex a
Sidharth Kapur [Tue, 15 Mar 2016 15:53:52 +0000 (10:53 -0500)] 
Add Binary instance for Complex a

3 years agoFail rather than throw exception when decoding Bool and Ordering
Lennart Kolmodin [Sun, 6 Mar 2016 13:54:29 +0000 (14:54 +0100)] 
Fail rather than throw exception when decoding Bool and Ordering

Decoding Bool and Ordering was not graceful in case of invalid input.
Trying to decode (2 :: Word8) to a Bool would throw an exception
in GHC.Enum.toEnum as only the values 0 and 1 are defined.

We work around that in this patch by not using toEnum. In case
of unexpected input, we fail using 'fail'.

This fixes #108.

3 years agoMove end of {-# RULES #-} to be more forgiving for CPP
Lennart Kolmodin [Mon, 8 Feb 2016 21:09:16 +0000 (22:09 +0100)] 
Move end of {-# RULES #-} to be more forgiving for CPP

This fixes #105. Older GHC versions + clang ran into trouble, which this commit
fixes.

3 years agoBump to version 0.8.2.0 0.8.2.0
Lennart Kolmodin [Tue, 2 Feb 2016 20:57:25 +0000 (21:57 +0100)] 
Bump to version 0.8.2.0

3 years agoMerge pull request #104 from hvr/pr/monadfail-cpp
Lennart Kolmodin [Tue, 2 Feb 2016 20:44:31 +0000 (21:44 +0100)] 
Merge pull request #104 from hvr/pr/monadfail-cpp

Define MonadFail instance for Get Monad

3 years agoDefine MonadFail instance for Get Monad
Herbert Valerio Riedel [Tue, 2 Feb 2016 20:20:00 +0000 (21:20 +0100)] 
Define MonadFail instance for Get Monad

3 years agoChange next version to be 0.8.1.0 0.8.1.0
Lennart Kolmodin [Tue, 2 Feb 2016 19:55:25 +0000 (20:55 +0100)] 
Change next version to be 0.8.1.0

PVP said 0.9.0.0 was not required.

3 years agoUse getIntX/putIntX in the Binary class instances.
Lennart Kolmodin [Tue, 26 Jan 2016 19:23:34 +0000 (20:23 +0100)] 
Use getIntX/putIntX in the Binary class instances.

3 years agoUpdate changelog.md.
Lennart Kolmodin [Tue, 26 Jan 2016 17:53:50 +0000 (18:53 +0100)] 
Update changelog.md.

3 years agoDocumentation fix.
Lennart Kolmodin [Tue, 26 Jan 2016 17:46:34 +0000 (18:46 +0100)] 
Documentation fix.

3 years agoMerge remote-tracking branch 'shimuuar/signed-int'
Lennart Kolmodin [Tue, 26 Jan 2016 17:45:56 +0000 (18:45 +0100)] 
Merge remote-tracking branch 'shimuuar/signed-int'

3 years agoUpdate changelog.
Lennart Kolmodin [Mon, 25 Jan 2016 21:15:17 +0000 (22:15 +0100)] 
Update changelog.

3 years agoMerge remote-tracking branch 'qnikst/bytestring-short'
Lennart Kolmodin [Mon, 25 Jan 2016 21:14:01 +0000 (22:14 +0100)] 
Merge remote-tracking branch 'qnikst/bytestring-short'

3 years agoSupport ShortByteStrings.
Alexander Vershilov [Sat, 23 Jan 2016 00:21:13 +0000 (03:21 +0300)] 
Support ShortByteStrings.

Implement Binary instance and builders for ShortByteString.

3 years agoAdd arbitrary for Action in Arbitrary instance. 0.8.0.1
Lennart Kolmodin [Fri, 22 Jan 2016 21:09:25 +0000 (22:09 +0100)] 
Add arbitrary for Action in Arbitrary instance.

3 years agoTurn on more warnings if ghc >= 7.11.
Lennart Kolmodin [Thu, 21 Jan 2016 10:24:39 +0000 (11:24 +0100)] 
Turn on more warnings if ghc >= 7.11.

3 years agoBump to 0.8.0.1.
Lennart Kolmodin [Thu, 21 Jan 2016 09:45:22 +0000 (10:45 +0100)] 
Bump to 0.8.0.1.

3 years agoAdd @dcoutts's comments regarding accursedUnutterablePerformIO.
Lennart Kolmodin [Mon, 18 Jan 2016 22:15:55 +0000 (23:15 +0100)] 
Add @dcoutts's comments regarding accursedUnutterablePerformIO.

3 years agoUse accursedUnutterablePerformIO rather than inlinePerformIO.
Lennart Kolmodin [Sun, 20 Dec 2015 22:29:38 +0000 (23:29 +0100)] 
Use accursedUnutterablePerformIO rather than inlinePerformIO.

Let's share the address space with a malevolent agent of chaos.

3 years agoClean up old CPP code.
Lennart Kolmodin [Sun, 20 Dec 2015 22:08:11 +0000 (23:08 +0100)] 
Clean up old CPP code.

3 years agoChangelog update. binary-0.8.0.0-release
Lennart Kolmodin [Sun, 20 Dec 2015 21:53:43 +0000 (22:53 +0100)] 
Changelog update.

3 years agoRemove attempt to do clever fusion of code in applicative style.
Lennart Kolmodin [Sun, 20 Dec 2015 21:37:27 +0000 (22:37 +0100)] 
Remove attempt to do clever fusion of code in applicative style.

Removing as it complicates binary and it's very hard for client code to
trigger.

3 years agoMerge pull request #96 from hvr/pr/semigroup
Lennart Kolmodin [Sun, 20 Dec 2015 20:27:52 +0000 (21:27 +0100)] 
Merge pull request #96 from hvr/pr/semigroup

Define Semigroup instance for base>=4.9

3 years agoUpdate changelog.md with recent changes.
Lennart Kolmodin [Sun, 20 Dec 2015 20:26:52 +0000 (21:26 +0100)] 
Update changelog.md with recent changes.

3 years agoMerge pull request #97 from hvr/pr/redundant-constraints
Lennart Kolmodin [Sun, 20 Dec 2015 20:09:13 +0000 (21:09 +0100)] 
Merge pull request #97 from hvr/pr/redundant-constraints

Drop redundant constraints

3 years agoMerge pull request #93 from hvr/pr/canonical-monad-instances
Lennart Kolmodin [Sun, 20 Dec 2015 18:50:23 +0000 (19:50 +0100)] 
Merge pull request #93 from hvr/pr/canonical-monad-instances

Canonicalise Monad instances

3 years agoMerge pull request #84 from phadej/fixed
Lennart Kolmodin [Sun, 20 Dec 2015 17:53:06 +0000 (18:53 +0100)] 
Merge pull request #84 from phadej/fixed

Data.Fixed instance

3 years agoDrop redundant constraints
Herbert Valerio Riedel [Sat, 19 Dec 2015 10:34:52 +0000 (11:34 +0100)] 
Drop redundant constraints

GHC HEAD warns about these

3 years agoDefine Semigroup instance for base>=4.9
Herbert Valerio Riedel [Sat, 19 Dec 2015 10:23:22 +0000 (11:23 +0100)] 
Define Semigroup instance for base>=4.9

This makes `binary` `-Wcompat`-clean for GHC 8.0

3 years agoCanonicalise Monad instances
Herbert Valerio Riedel [Tue, 24 Nov 2015 13:49:03 +0000 (14:49 +0100)] 
Canonicalise Monad instances

This avoids potential performance issues as well as
future proofing code.

3 years agoMerge pull request #95 from ezyang/binary-splitg
Lennart Kolmodin [Fri, 18 Dec 2015 15:00:20 +0000 (16:00 +0100)] 
Merge pull request #95 from ezyang/binary-splitg

Split GBinary into GBinaryGet and GBinaryPut, speeds up compilation.

3 years agoSplit GBinary into GBinaryGet and GBinaryPut, speeds up compilation.
Edward Z. Yang [Fri, 18 Dec 2015 01:05:29 +0000 (17:05 -0800)] 
Split GBinary into GBinaryGet and GBinaryPut, speeds up compilation.

Consider:

    {-# LANGUAGE DeriveGeneric #-}
    module A where
    import Data.Binary
    import GHC.Generics
    data T = T
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     () () () () () () () () () ()
     deriving Generic
    instance Binary T

Without this patch, on GHC 7.10.2, building this -O2 takes 6.7s.  With
this patch, it takes 1.7s.  Amazing.  (There are modest improvements
with other versions of GHC too.)

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
3 years agoImport Control.Applicative for older GHC
Alexey Khudyakov [Sun, 15 Nov 2015 15:45:47 +0000 (18:45 +0300)] 
Import Control.Applicative for older GHC

3 years agoMerge branch 'master' into signed-int
Alexey Khudyakov [Sun, 15 Nov 2015 15:42:53 +0000 (18:42 +0300)] 
Merge branch 'master' into signed-int

3 years agoMerge pull request #90 from phadej/since-0.8
Lennart Kolmodin [Fri, 13 Nov 2015 10:17:29 +0000 (11:17 +0100)] 
Merge pull request #90 from phadej/since-0.8

Add since annotations

3 years agoAdd since annotations
Oleg Grenrus [Fri, 13 Nov 2015 05:35:25 +0000 (07:35 +0200)] 
Add since annotations

3 years agoAdd Binary Version compatibility tests
Oleg Grenrus [Wed, 11 Nov 2015 18:18:52 +0000 (20:18 +0200)] 
Add Binary Version compatibility tests

3 years agoAdd Binary (Data.Fixed a) instance
Oleg Grenrus [Tue, 25 Aug 2015 20:08:25 +0000 (23:08 +0300)] 
Add Binary (Data.Fixed a) instance

3 years agoMerge pull request #89 from phadej/bump-0.8
Lennart Kolmodin [Thu, 12 Nov 2015 16:44:39 +0000 (17:44 +0100)] 
Merge pull request #89 from phadej/bump-0.8

Bump version to 0.8.0.0

3 years agoFix documentation
Alexey Khudyakov [Thu, 12 Nov 2015 10:40:58 +0000 (13:40 +0300)] 
Fix documentation

3 years agoBump version to 0.8.0.0
Oleg Grenrus [Thu, 12 Nov 2015 04:34:22 +0000 (06:34 +0200)] 
Bump version to 0.8.0.0

3 years agoRemove duplicate Binary instance of Version.
Lennart Kolmodin [Wed, 11 Nov 2015 16:26:52 +0000 (17:26 +0100)] 
Remove duplicate Binary instance of Version.

3 years agoMerge branch 'phadej/version'
Lennart Kolmodin [Wed, 11 Nov 2015 15:06:23 +0000 (16:06 +0100)] 
Merge branch 'phadej/version'

3 years agoUse applicative form in 'get' for Version.
Lennart Kolmodin [Wed, 11 Nov 2015 15:05:39 +0000 (16:05 +0100)] 
Use applicative form in 'get' for Version.

3 years agoMerge branch 'feature/void-binary-instance'
Lennart Kolmodin [Wed, 11 Nov 2015 10:51:36 +0000 (11:51 +0100)] 
Merge branch 'feature/void-binary-instance'

3 years agoOnly support Void for >= GHC 7.10.
Lennart Kolmodin [Wed, 11 Nov 2015 10:12:14 +0000 (11:12 +0100)] 
Only support Void for >= GHC 7.10.

3 years agoAttempt to reduce compile time on Travis CI.
Lennart Kolmodin [Thu, 29 Oct 2015 17:14:00 +0000 (18:14 +0100)] 
Attempt to reduce compile time on Travis CI.

As suggested at https://github.com/hvr/multi-ghc-travis, reduce the
effect of bug https://ghc.haskell.org/trac/ghc/ticket/9221.

3 years agoUse Travis CI containers.
Lennart Kolmodin [Thu, 29 Oct 2015 16:20:56 +0000 (17:20 +0100)] 
Use Travis CI containers.

3 years agoAdd Binary Void instance
Brian McKenna [Fri, 23 Oct 2015 03:44:31 +0000 (14:44 +1100)] 
Add Binary Void instance

This is so that we can write and read things like [Void], or (Expr Void)
- something I'm actually doing in Morte.

https://github.com/Gabriel439/Haskell-Morte-Library/pull/26

The reader always fails if you actually try to get an instance of it.
Trying to access a void value should not happen for well-formed
instances, for example:

    *Data.Binary Data.Void> decode $ encode ([] :: [Void]) :: [Void]
    []

3 years agoMerge pull request #86 from basvandijk/optimize-roll
Lennart Kolmodin [Tue, 6 Oct 2015 13:40:17 +0000 (15:40 +0200)] 
Merge pull request #86 from basvandijk/optimize-roll

Optimize roll by using foldl' instead of foldr

3 years agoAdd Binary Version instance
Oleg Grenrus [Fri, 2 Oct 2015 10:10:49 +0000 (13:10 +0300)] 
Add Binary Version instance

3 years agoOptimize roll by using foldl' instead of foldr
Bas van Dijk [Mon, 28 Sep 2015 20:39:28 +0000 (22:39 +0200)] 
Optimize roll by using foldl' instead of foldr

The "roll" benchmarks in the get executable show the difference:

  get roll
  benchmarking roll/foldr
  time                 547.4 ms   (537.8 ms .. 553.5 ms)
                       1.000 R²   (1.000 R² .. 1.000 R²)
  mean                 549.4 ms   (547.2 ms .. 550.4 ms)
  std dev              1.857 ms   (0.0 s .. 1.896 ms)
  variance introduced by outliers: 19% (moderately inflated)

  benchmarking roll/foldl'
  time                 434.7 ms   (426.4 ms .. 443.1 ms)
                       1.000 R²   (1.000 R² .. 1.000 R²)
  mean                 433.7 ms   (432.3 ms .. 434.7 ms)
  std dev              1.472 ms   (0.0 s .. 1.696 ms)
  variance introduced by outliers: 19% (moderately inflated)

The "Integer/decode" benchmark shows the actual decoding speed.
First the old implementation based on foldr:

  get Integer/decode
  benchmarking Integer/decode
  time                 552.9 ms   (540.2 ms .. 569.3 ms)
                       1.000 R²   (1.000 R² .. 1.000 R²)
  mean                 558.2 ms   (556.1 ms .. 559.3 ms)
  std dev              1.824 ms   (0.0 s .. 1.906 ms)
  variance introduced by outliers: 19% (moderately inflated)

The new implementation based on foldl':

  get Integer/decode
  benchmarking Integer/decode
  time                 457.5 ms   (406.2 ms .. 505.6 ms)
                       0.998 R²   (0.994 R² .. 1.000 R²)
  mean                 455.9 ms   (448.3 ms .. 462.3 ms)
  std dev              10.11 ms   (0.0 s .. 11.02 ms)
  variance introduced by outliers: 19% (moderately inflated)

4 years agobenchmark builder: Specify Int as we otherwise default to Integer.
Lennart Kolmodin [Fri, 14 Aug 2015 20:31:12 +0000 (22:31 +0200)] 
benchmark builder: Specify Int as we otherwise default to Integer.

The benchmark executes 25% faster, time which could not be attribute to
the speed of binary itself.

4 years agoRemove unused import.
Lennart Kolmodin [Fri, 14 Aug 2015 20:31:00 +0000 (22:31 +0200)] 
Remove unused import.

4 years agoConditionally include Data.Monoid for older GHC versions.
Lennart Kolmodin [Fri, 14 Aug 2015 20:30:16 +0000 (22:30 +0200)] 
Conditionally include Data.Monoid for older GHC versions.

4 years agoConditionally include Control.Applicative for older GHC versions.
Lennart Kolmodin [Fri, 14 Aug 2015 20:22:42 +0000 (22:22 +0200)] 
Conditionally include Control.Applicative for older GHC versions.

4 years agoConditionally include <$> for older GHC versions.
Lennart Kolmodin [Fri, 14 Aug 2015 10:56:59 +0000 (12:56 +0200)] 
Conditionally include <$> for older GHC versions.

4 years agoAdd new deps to .travis.yml file.
Lennart Kolmodin [Thu, 13 Aug 2015 20:39:01 +0000 (22:39 +0200)] 
Add new deps to .travis.yml file.

Due to the dependency cycle we need to manually preinstall all deps
before we attempt to configure/build binary.

4 years agoAdd benchmark for Generic generated Binary instances.
Lennart Kolmodin [Thu, 13 Aug 2015 20:25:19 +0000 (22:25 +0200)] 
Add benchmark for Generic generated Binary instances.

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.

4 years agoCompile benchmark get with -Wall.
Lennart Kolmodin [Thu, 13 Aug 2015 20:12:11 +0000 (22:12 +0200)] 
Compile benchmark get with -Wall.

4 years agoStructure the benchmarks in the the "get" bench in groups.
Lennart Kolmodin [Sun, 9 Aug 2015 16:14:28 +0000 (18:14 +0200)] 
Structure the  benchmarks in the the "get" bench in groups.