on master help sign in
Disable some redundant serialize benchmarks
3e93e22Harendra Kumar
benchmark/Streamly/Benchmark/Data/Serialize.hs+8−2
@@ -229,6 +229,7 @@ instance Eq Product25 where
229-- Simple non-recursive ADT
229-- Simple non-recursive ADT
230-------------------------------------------------------------------------------
230-------------------------------------------------------------------------------
231
231
232+{-
232data CustomDT1
233data CustomDT1
233 = CDT1C1
234 = CDT1C1
234 | CDT1C2 Int
235 | CDT1C2 Int
@@ -246,6 +247,7 @@ instance NFData CustomDT1 where
246 rnf CDT1C1 = ()
247 rnf CDT1C1 = ()
247 rnf (CDT1C2 i) = i `seq` ()
248 rnf (CDT1C2 i) = i `seq` ()
248 rnf (CDT1C3 i1 i2) = i1 `seq` i2 `seq` ()
249 rnf (CDT1C3 i1 i2) = i1 `seq` i2 `seq` ()
250+-}
249
251
250-------------------------------------------------------------------------------
252-------------------------------------------------------------------------------
251-- Recursive ADT
253-- Recursive ADT
@@ -329,6 +331,7 @@ benchSink name times f = bench name (nfIO (randomRIO (times, times) >>= f))
329-- Serialization Helpers
331-- Serialization Helpers
330-------------------------------------------------------------------------------
332-------------------------------------------------------------------------------
331
333
334+{-
332{-# INLINE pokeWithSize #-}
335{-# INLINE pokeWithSize #-}
333pokeWithSize :: SERIALIZE_CLASS a => MutableByteArray -> a -> IO ()
336pokeWithSize :: SERIALIZE_CLASS a => MutableByteArray -> a -> IO ()
334pokeWithSize arr val = do
337pokeWithSize arr val = do
@@ -341,6 +344,7 @@ pokeTimesWithSize val times = do
341 let n = getSize val
344 let n = getSize val
342 arr <- newBytes n
345 arr <- newBytes n
343 loopWith times pokeWithSize arr val
346 loopWith times pokeWithSize arr val
347+-}
344
348
345{-# INLINE poke #-}
349{-# INLINE poke #-}
346poke :: SERIALIZE_CLASS a => MutableByteArray -> a -> IO ()
350poke :: SERIALIZE_CLASS a => MutableByteArray -> a -> IO ()
@@ -436,6 +440,7 @@ benchConst gname f times =
436 bgroup gname
440 bgroup gname
437 [ let !n = getSize Unit
441 [ let !n = getSize Unit
438 in benchSink "Unit" times (f n Unit)
442 in benchSink "Unit" times (f n Unit)
443+ {-
439 , let !n = getSize CDT1C1
444 , let !n = getSize CDT1C1
440 in benchSink "C1" times (f n CDT1C1)
445 in benchSink "C1" times (f n CDT1C1)
441 , let val = CDT1C2 5
446 , let val = CDT1C2 5
@@ -444,6 +449,7 @@ benchConst gname f times =
444 , let val = CDT1C3 5 2
449 , let val = CDT1C3 5 2
445 !n = getSize val
450 !n = getSize val
446 in benchSink "C3" (times `div` 3) (f n val)
451 in benchSink "C3" (times `div` 3) (f n val)
452+ -}
447 , let !n = getSize Sum21
453 , let !n = getSize Sum21
448 in benchSink "Sum2" times (f n Sum21)
454 in benchSink "Sum2" times (f n Sum21)
449 , let !n = getSize Sum2525
455 , let !n = getSize Sum2525
@@ -488,13 +494,13 @@ allBenchmarks tInt lInt times =
488#endif
494#endif
489 ]
495 ]
490 , benchConst "poke" (const pokeTimes) times
496 , benchConst "poke" (const pokeTimes) times
491− , benchConst "pokeWithSize" (const pokeTimesWithSize) times
497+ -- , benchConst "pokeWithSize" (const pokeTimesWithSize) times
492 , benchConst "encode" (const encodeTimes) times
498 , benchConst "encode" (const encodeTimes) times
493 , benchConst "peek" peekTimes times
499 , benchConst "peek" peekTimes times
494 , benchConst "roundtrip" (const roundtrip) times
500 , benchConst "roundtrip" (const roundtrip) times
495#ifndef USE_UNBOX
501#ifndef USE_UNBOX
496 , benchVar "poke" (const pokeTimes) tInt lInt 1
502 , benchVar "poke" (const pokeTimes) tInt lInt 1
497− , benchVar "pokeWithSize" (const pokeTimesWithSize) tInt lInt 1
503+ -- , benchVar "pokeWithSize" (const pokeTimesWithSize) tInt lInt 1
498 , benchVar "encode" (const encodeTimes) tInt lInt 1
504 , benchVar "encode" (const encodeTimes) tInt lInt 1
499 , benchVar "peek" peekTimes tInt lInt 1
505 , benchVar "peek" peekTimes tInt lInt 1
500 , benchVar "roundtrip" (const roundtrip) tInt lInt 1
506 , benchVar "roundtrip" (const roundtrip) tInt lInt 1