@@ -8,6 +8,7 @@ import Array
88import LargeDictionary
99import ArrayBench
1010import ListBench
11+import AnimateBench
1112import Random
1213import Time
1314{-| Compile this with --output=Benchmarks.html to generate
@@ -34,6 +35,8 @@ mySuite =
3435
3536 , Benchmark.bench2 "200 lookups in array of 500 elems: " ArrayBench.randomLookups indices200 (Array.fromList [1 .. 500] )
3637 , Benchmark.bench2 "200 lookups in list of 500 elems: " ListBench.randomLookups indices200 ([1 .. 500] )
38+
39+ , Benchmark.bench1 "30s simulated animation: " AnimateBench.runAnimation timeSteps30s
3740 ]
3841
3942
@@ -82,21 +85,31 @@ indexGen =
8285--across multiple runs of the benchmark
8386
8487--seed for our index generation
85−indexSeed = Random.initialSeed 56
88+indexSeed =
89+ Random.initialSeed 56
8690
8791
8892--Seed for our float generation
89−seed = Random.initialSeed 23
93+seed =
94+ Random.initialSeed 23
9095
9196
9297--Pseudo-random array of 500 floating point numbers
93−array500 = (ArrayBench.randomArray floatGen 500 seed)
98+array500 =
99+ (ArrayBench.randomArray floatGen 500 seed)
94100
95101
96102--Same contents as array500, but in list form
97−list500 = (ListBench.randomList floatGen 500 seed)
103+list500 =
104+ (ListBench.randomList floatGen 500 seed)
98105
99106
100107--Pseudo random list of 200 indices between 0 and 499
101−indices200 = (ListBench.randomList indexGen 200 indexSeed)
108+indices200 =
109+ (ListBench.randomList indexGen 200 indexSeed)
110+
111+
112+--List of timesteps simulating 30 seconds of animation at 30fps
113+timeSteps30s =
114+ List.map (\x -> (1.0 / 30.0) * (toFloat x * Time.second) ) [1 .. 900]
102115