mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
update benchs
This commit is contained in:
parent
76a3fb953e
commit
edccae0c89
1 changed files with 18 additions and 1 deletions
|
|
@ -751,6 +751,7 @@ module Tbl = struct
|
||||||
; wbt Str
|
; wbt Str
|
||||||
; hashtrie Str
|
; hashtrie Str
|
||||||
; persistent_hashtbl Str
|
; persistent_hashtbl Str
|
||||||
|
; flat_tbl Str
|
||||||
(* ; hamt Str *)
|
(* ; hamt Str *)
|
||||||
; trie
|
; trie
|
||||||
]
|
]
|
||||||
|
|
@ -800,6 +801,21 @@ module Tbl = struct
|
||||||
in
|
in
|
||||||
B.throughputN 3 ~repeat (List.map make modules_int)
|
B.throughputN 3 ~repeat (List.map make modules_int)
|
||||||
|
|
||||||
|
let bench_replace_string_to l n =
|
||||||
|
let keys = CCList.( 1 -- n |> map (fun i->string_of_int i,i)) in
|
||||||
|
let make (module T : STRING_MUT) =
|
||||||
|
let run() =
|
||||||
|
let t = T.create 50 in
|
||||||
|
List.iter
|
||||||
|
(fun (k,v) -> T.replace t k v)
|
||||||
|
keys
|
||||||
|
in
|
||||||
|
T.name, run, ()
|
||||||
|
in
|
||||||
|
B.throughputN 3 ~repeat (List.map make l)
|
||||||
|
|
||||||
|
let bench_replace_string = bench_replace_string_to modules_string
|
||||||
|
|
||||||
module type INT_FIND = sig
|
module type INT_FIND = sig
|
||||||
type 'a t
|
type 'a t
|
||||||
val name : string
|
val name : string
|
||||||
|
|
@ -875,7 +891,8 @@ module Tbl = struct
|
||||||
B.Tree.register ("tbl" @>>>
|
B.Tree.register ("tbl" @>>>
|
||||||
[ "add_int" @>> app_ints bench_add [10; 100; 1_000; 10_000;]
|
[ "add_int" @>> app_ints bench_add [10; 100; 1_000; 10_000;]
|
||||||
; "add_string" @>> app_ints bench_add_string [10; 100; 1_000; 10_000;]
|
; "add_string" @>> app_ints bench_add_string [10; 100; 1_000; 10_000;]
|
||||||
; "replace" @>> app_ints bench_replace [10; 100; 1_000; 10_000]
|
; "replace_int" @>> app_ints bench_replace [10; 100; 1_000; 10_000]
|
||||||
|
; "replace_string" @>> app_ints bench_replace_string [10; 100; 1_000; 10_000]
|
||||||
; "find" @>> app_ints bench_find [10; 20; 100; 1_000; 10_000]
|
; "find" @>> app_ints bench_find [10; 20; 100; 1_000; 10_000]
|
||||||
; "find_string" @>> app_ints bench_find_string [10; 20; 100; 1_000; 10_000]
|
; "find_string" @>> app_ints bench_find_string [10; 20; 100; 1_000; 10_000]
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue