mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
Merge pull request #3 from Drup/master
Remove the for loop in bench_persistent_read.
This commit is contained in:
commit
e1cbfedeab
1 changed files with 7 additions and 9 deletions
|
|
@ -111,10 +111,8 @@ let bench_array n =
|
||||||
let a = Sequence.to_array Sequence.(1 -- n) in
|
let a = Sequence.to_array Sequence.(1 -- n) in
|
||||||
Sequence.of_array a
|
Sequence.of_array a
|
||||||
|
|
||||||
let read s n =
|
let read s =
|
||||||
for i = 0 to n do
|
|
||||||
Sequence.map (fun x -> x + 1) s
|
Sequence.map (fun x -> x + 1) s
|
||||||
done
|
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
let bench_n n =
|
let bench_n n =
|
||||||
|
|
@ -126,11 +124,11 @@ let () =
|
||||||
let array = bench_current n in
|
let array = bench_current n in
|
||||||
let naive = bench_naive n in
|
let naive = bench_naive n in
|
||||||
Benchmark.throughputN 5
|
Benchmark.throughputN 5
|
||||||
[ "mlist", read mlist, 1
|
[ "mlist", read, mlist
|
||||||
; "list", read list, 1
|
; "list", read, list
|
||||||
; "current", read current, 1
|
; "current", read, current
|
||||||
; "array", read array, 1
|
; "array", read, array
|
||||||
; "naive", read naive, 1
|
; "naive", read, naive
|
||||||
]
|
]
|
||||||
in Benchmark.tabulate res
|
in Benchmark.tabulate res
|
||||||
in
|
in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue