This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
21
unikernel/duniverse/csexp/bench/csexp_bench.ml
Normal file
21
unikernel/duniverse/csexp/bench/csexp_bench.ml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
open StdLabels
|
||||
|
||||
module Sexp = struct
|
||||
type t =
|
||||
| Atom of string
|
||||
| List of t list
|
||||
end
|
||||
|
||||
module Csexp = Csexp.Make (Sexp)
|
||||
|
||||
let atom = Sexp.Atom (String.make 128 'x')
|
||||
|
||||
let rec gen_sexp depth =
|
||||
if depth = 0 then atom
|
||||
else
|
||||
let x = gen_sexp (depth - 1) in
|
||||
List [ x; x ]
|
||||
|
||||
let s = Sys.opaque_identity (Csexp.to_string (gen_sexp 16))
|
||||
|
||||
let%bench "of_string" = ignore (Csexp.parse_string s : _ result)
|
||||
12
unikernel/duniverse/csexp/bench/dune
Normal file
12
unikernel/duniverse/csexp/bench/dune
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(library
|
||||
(name csexp_bench)
|
||||
(libraries csexp)
|
||||
(library_flags -linkall)
|
||||
(preprocess
|
||||
(pps ppx_bench))
|
||||
(modules csexp_bench))
|
||||
|
||||
(executable
|
||||
(name main)
|
||||
(modules main)
|
||||
(libraries core_bench.inline_benchmarks csexp_bench))
|
||||
1
unikernel/duniverse/csexp/bench/main.ml
Normal file
1
unikernel/duniverse/csexp/bench/main.ml
Normal file
|
|
@ -0,0 +1 @@
|
|||
let () = Inline_benchmarks_public.Runner.main ~libname:"csexp_bench"
|
||||
4
unikernel/duniverse/csexp/bench/runner.sh
Executable file
4
unikernel/duniverse/csexp/bench/runner.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
export BENCHMARKS_RUNNER=TRUE
|
||||
export BENCH_LIB=csexp_bench
|
||||
exec dune exec -- ./main.exe -fork -run-without-cross-library-inlining "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue