This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
35
unikernel/duniverse/ocaml-uri/benchmarks/benchmark.ml
Normal file
35
unikernel/duniverse/ocaml-uri/benchmarks/benchmark.ml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
open Core
|
||||
open Core_bench
|
||||
|
||||
let make_bench_parsing (name, str) =
|
||||
Bench.Test.create ~name
|
||||
(fun () -> Uri.of_string str)
|
||||
|
||||
let parsing_benchs = [
|
||||
|
||||
"small", "http://foo.com" ;
|
||||
|
||||
"ipv6",
|
||||
"http://%5Bdead%3Abeef%3A%3Adead%3A0%3Abeaf%5D" ;
|
||||
|
||||
"complete",
|
||||
"https://user:pass@foo.com:123/wh/at/ever?foo=1&bar=5#5";
|
||||
|
||||
"query",
|
||||
"//domain?f+1=bar&+f2=bar%212";
|
||||
|
||||
"path",
|
||||
"http://a/b/c/g;x?y#s";
|
||||
|
||||
"urn",
|
||||
"urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6";
|
||||
]
|
||||
|
||||
let benchmarks = [
|
||||
Bench.Test.create_group ~name:"parsing"
|
||||
(List.map ~f:make_bench_parsing parsing_benchs);
|
||||
]
|
||||
|
||||
let () =
|
||||
Bench.make_command benchmarks
|
||||
|> Command_unix.run
|
||||
Loading…
Add table
Add a link
Reference in a new issue