Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file runner.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100openCoreopenCore_bench.StdmoduleEntry=Ppx_bench_lib.Benchmark_accumulator.Entryletx_library_inlining_warning~run_without_inlining~suppress_warnings=ifnotVersion_util.x_library_inliningthenbeginifnotsuppress_warningsthenCore.printf"Warning: X_LIBRARY_INLINING is not set to true, benchmarks may be inaccurate.\n%!";ifnotrun_without_inliningthenfailwith"If you would like to run benchmarks, and are ok with getting inaccurate \
results due to lack of cross library inlining, use the \
-run-without-cross-library-inlining flag."end(* The main function for the inline benchmarks *)letrun_benchmarks~libname~matching~no_sexp:_~run_config~run_without_inlining~suppress_warnings~display_config~analysis_configs?save_to_file()=x_library_inlining_warning~run_without_inlining~suppress_warnings;let_tbl,tests=Common.get_matching_tests~libnamematchinginifList.is_emptyteststhenprintf"No benchmarks to run!\n%!"elseBench.bench~run_config~analysis_configs~display_config?save_to_file~libname:libnametestsletmatching_param=letopenCommand.Paraminflag"matching"(listedstring)~doc:"REGEX Include only benchmarks matching the REGEX."letlist_command~libname=letopenCommand.Let_syntaxinCommand.basic~summary:"list benchmark names"[%map_openletmatching=matching_paraminfun()->let_,tests=Common.get_matching_tests~libnamematchinginList.itertests~f:(funtest->print_endline(Core_bench.Test.nametest))]letcommand~libname=letopenCommand.Let_syntaxinBench.make_command_ext~summary:(sprintf"run inline benchmarks of %s now."libname)[%map_openletmatching=matching_paramandno_sexp=flag"no-sexp"no_arg~doc:" Do not generate a benchmarks.sexp file (quicker)."andrun_without_inlining=flag"run-without-cross-library-inlining"no_arg~doc:" Run benchmarks even when compiled with X_LIBRARY_INLINING=false."andsuppress_warnings=flag"suppress-warnings"no_arg~doc:" Suppress warnings when clean output needed"infunargs->letshould_run=Option.value_map~default:false~f:((=)"TRUE")(Sys.getenv"BENCHMARKS_RUNNER")inifnotshould_runthenfailwith"Don't run directly, run using the benchmarks_runner script.";matchargswith|(analysis_configs,display_config,`Run(save_to_file,run_config))->run_benchmarks~libname~matching~no_sexp~run_config~run_without_inlining~suppress_warnings~display_config~analysis_configs?save_to_file()|(_analysis_configs,_display_config,`From_file_filenames)->failwith"Loading saved files is not supported for inline executables."]letmain~libname=Command.run(command~libname)