@@ -5,6 +5,7 @@ import Task exposing (Task, andThen)
6import Array
6import Array
7import Random
7import Random
10import LargeDictionary
11import LargeDictionary
@@ -19,6 +20,7 @@ import CtorBench
19import SmallCtorBench
20import SmallCtorBench
20import PatternMatchBench
21import PatternMatchBench
21import IfBench
22import IfBench
23{-| Compile this with --output=Benchmarks.html to generate
25{-| Compile this with --output=Benchmarks.html to generate
24 a webpage, which runs the benchmarks and shows the results.
26 a webpage, which runs the benchmarks and shows the results.
@@ -53,6 +55,10 @@ mySuite =
53 , Benchmark.bench1 "Array custom foldl, 500 elems: " ArrayBench.customFoldrMeanStddev array500
55 , Benchmark.bench1 "Array custom foldl, 500 elems: " ArrayBench.customFoldrMeanStddev array500
54 , Benchmark.bench3 "Array square nth elem, 500 elems: " ArrayBench.updateNRandomIndices (\x -> x*x) indices200 array500
56 , Benchmark.bench3 "Array square nth elem, 500 elems: " ArrayBench.updateNRandomIndices (\x -> x*x) indices200 array500
58+ , Benchmark.bench1 "Dict native foldr, 500 elems: " DictBench.foldrMeanStddev dict500
59+ , Benchmark.bench1 "Dict native foldl, 500 elems: " DictBench.foldlMeanStddev dict500
60+ , Benchmark.bench3 "Dict square nth elem, 500 elems: " DictBench.updateNRandomIndices (\x -> x*x) indices200 dict500
56 , Benchmark.bench1 "List native foldr, 500 elems: " ListBench.foldrMeanStddev list500
62 , Benchmark.bench1 "List native foldr, 500 elems: " ListBench.foldrMeanStddev list500
57 , Benchmark.bench1 "List native foldl, 500 elems: " ListBench.foldlMeanStddev list500
63 , Benchmark.bench1 "List native foldl, 500 elems: " ListBench.foldlMeanStddev list500
58 , Benchmark.bench1 "List custom foldr, 500 elems: " ListBench.customFoldrMeanStddev list500
64 , Benchmark.bench1 "List custom foldr, 500 elems: " ListBench.customFoldrMeanStddev list500
@@ -61,6 +67,7 @@ mySuite =
62 , Benchmark.bench2 "200 lookups in array of 500 elems: " ArrayBench.randomLookups indices200 (Array.fromList [1 .. 500] )
68 , Benchmark.bench2 "200 lookups in array of 500 elems: " ArrayBench.randomLookups indices200 (Array.fromList [1 .. 500] )
63 , Benchmark.bench2 "200 lookups in list of 500 elems: " ListBench.randomLookups indices200 ([1 .. 500] )
69 , Benchmark.bench2 "200 lookups in list of 500 elems: " ListBench.randomLookups indices200 ([1 .. 500] )
70+ , Benchmark.bench2 "200 lookups in dict of 500 elems: " DictBench.randomLookups indices200 (Dict.fromList (List.map2 (,) [1 .. 500] [1 .. 500]) )
65 , Benchmark.bench1 "30s simulated animation @ 30fps: " AnimateBench.runAnimation timeSteps30s
72 , Benchmark.bench1 "30s simulated animation @ 30fps: " AnimateBench.runAnimation timeSteps30s
@@ -120,6 +127,12 @@ seed =
120--Pseudo-random array of 500 floating point numbers
127--Pseudo-random array of 500 floating point numbers
121array500 =
128array500 =
122 (ArrayBench.randomArray floatGen 500 seed)
129 (ArrayBench.randomArray floatGen 500 seed)
132+--Pseudo-random dictionary, indexed 0 .. 500, of 500 floating point numbers
134+ (DictBench.randomDict floatGen 500 seed)
125--Same contents as array500, but in list form
138--Same contents as array500, but in list form