File: Benchmark.hs

package info (click to toggle)
haskell-reflection 2.1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: haskell: 878; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Criterion.Main

import qualified Data.Reflection as Old
import qualified Data.NewReflection as New

old :: [Int] -> [Int]
old = map (\x -> Old.reify x Old.reflect)

new :: [Int] -> [Int]
new = map (\x -> New.reify x New.reflect)

main :: IO ()
main = defaultMain
    [ bench "old" $ nf old [1..100000]
    , bench "new" $ nf new [1..100000]
    ]