add record updates to benching example

This commit is contained in:
Matthew Griffith 2020-07-28 23:29:39 -04:00
parent 2d4d7d8ae8
commit b468b77a9c

View File

@ -37,17 +37,35 @@ addMyType mine sum =
sum
type alias MyRecord =
{ one : Int
, two : Int
, three : Int
}
main : BenchmarkProgram
main =
Benchmark.Runner.program suite
updateRecord attr record =
{ record | one = 87 }
suite : Benchmark
suite =
describe "List of MyType"
[ -- nest as many descriptions as you like
describe "slice"
[ benchmark "sum 1000 entities in a list" <|
describe "Benchmarks"
[
benchmark "sum 1000 entities in a list" <|
\_ -> List.foldl addMyType 0 many
]
, benchmark "1000 record updates" <|
\_ -> List.foldl updateRecord
{ one = 1
, two = 2
, three = 3
}
many
]