Commits

basvandijk  committed e28bb51

Fix benchmarks/AesonCompareAutoInstances.hs

  • Participants
  • Parent commits 7e7fb93

Comments (0)

Files changed (1)

File benchmarks/AesonCompareAutoInstances.hs

 
 --------------------------------------------------------------------------------
 
-import Criterion.Main
+import Criterion.Main hiding (defaultOptions)
 
 import Control.DeepSeq (NFData, rnf, deepseq)
 
 instance FromJSON a => FromJSON (D a)
 
 thDToJSON :: ToJSON a => D a -> Value
-thDToJSON = $(mkToJSON id ''D)
+thDToJSON = $(mkToJSON defaultOptions ''D)
 
 thDParseJSON :: FromJSON a => Value -> Parser (D a)
-thDParseJSON = $(mkParseJSON id ''D)
+thDParseJSON = $(mkParseJSON defaultOptions ''D)
 
 thDFromJSON :: FromJSON a => Value -> Result (D a)
 thDFromJSON = parse thDParseJSON
 instance FromJSON BigRecord
 
 thBigRecordToJSON :: BigRecord -> Value
-thBigRecordToJSON = $(mkToJSON id ''BigRecord)
+thBigRecordToJSON = $(mkToJSON defaultOptions ''BigRecord)
 
 thBigRecordParseJSON :: Value -> Parser BigRecord
-thBigRecordParseJSON = $(mkParseJSON id ''BigRecord)
+thBigRecordParseJSON = $(mkParseJSON defaultOptions ''BigRecord)
 
 thBigRecordFromJSON :: Value -> Result BigRecord
 thBigRecordFromJSON = parse thBigRecordParseJSON
 instance FromJSON BigProduct
 
 thBigProductToJSON :: BigProduct -> Value
-thBigProductToJSON = $(mkToJSON id ''BigProduct)
+thBigProductToJSON = $(mkToJSON defaultOptions ''BigProduct)
 
 thBigProductParseJSON :: Value -> Parser BigProduct
-thBigProductParseJSON = $(mkParseJSON id ''BigProduct)
+thBigProductParseJSON = $(mkParseJSON defaultOptions ''BigProduct)
 
 thBigProductFromJSON :: Value -> Result BigProduct
 thBigProductFromJSON = parse thBigProductParseJSON
 instance FromJSON BigSum
 
 thBigSumToJSON :: BigSum -> Value
-thBigSumToJSON = $(mkToJSON id ''BigSum)
+thBigSumToJSON = $(mkToJSON defaultOptions ''BigSum)
 
 thBigSumParseJSON :: Value -> Parser BigSum
-thBigSumParseJSON = $(mkParseJSON id ''BigSum)
+thBigSumParseJSON = $(mkParseJSON defaultOptions ''BigSum)
 
 thBigSumFromJSON :: Value -> Result BigSum
 thBigSumFromJSON = parse thBigSumParseJSON
        ]
   ]
 
-group n th syb gen = bgroup n [ bench "th"      th
-                              , bench "syb"     syb
-                              , bench "generic" gen
-                              ]
+group n th syb gen = bcompare
+                     [ bgroup n [ bench "th"      th
+                                , bench "syb"     syb
+                                , bench "generic" gen
+                                ]
+                     ]