Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file bench_command_column.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106openCore(* module T = struct
* type t =
* [ `Name
* | `Cycles
* | `Nanos
* | `Confidence
* | `Allocated
* | `Percentage
* | `GC
* | `Speedup
* | `Samples
* ] with sexp, compare
* end
*
* module Map = Map.Make (T)
* include T *)(* include String *)(* let name_desc_assoc_list = [
* ("cycles" , `Cycles , "Number of CPU cycles (RDTSC) taken.");
* ("time" , `Nanos , "Number of nano secs taken.");
* ("confidence", `Confidence , "95% confidence interval and R^2 error for predictors.");
* ("alloc" , `Allocated , "Allocation of major, minor and promoted words.");
* ("gc" , `GC , "Show major and minor collections per 1000 runs.");
* ("percentage", `Percentage , "Relative execution time as a percentage.");
* ("speedup" , `Speedup , "Relative execution cost as a speedup.");
* ("samples" , `Samples , "Number of samples collected for profiling.");
* ] *)typet=|AnalysisofAnalysis_config.tlist|Display_columnofDisplay_column.tletname_desc_assoc_list=[("time",Analysis[Analysis_config.nanos_vs_runs],"Number of nano secs taken.");("cycles",Analysis[Analysis_config.cycles_vs_runs],"Number of CPU cycles (RDTSC) taken.");("alloc",AnalysisAnalysis_config.allocations_vs_runs,"Allocation of major, minor and promoted words.");("gc",AnalysisAnalysis_config.gc_vs_runs,"Show major and minor collections per 1000 runs.");("percentage",Display_column`Percentage,"Relative execution time as a percentage.");("speedup",Display_column`Speedup,"Relative execution cost as a speedup.");("samples",Display_column`Samples,"Number of samples collected for profiling.");]letcolumn_description_table=letmax=letlength(str,_,_)=String.lengthstrinList.reduce_exn~f:Int.max(List.mapname_desc_assoc_list~f:length)inletextendx=letslack=max-String.lengthxinx^String.makeslack' 'inString.concat~sep:"\n\t"(List.mapname_desc_assoc_list~f:(fun(name,_,desc)->sprintf"%s - %s"(extendname)desc))letname_assoc_list=List.mapname_desc_assoc_list~f:(fun(name,tag,_)->(name,tag))letof_stringcol=letcol,plus_prefix=matchString.chop_prefixcol~prefix:"+"with|Somecol->col,true|None->col,falseinlett=match(List.Assoc.find~equal:String.equalname_assoc_listcol),plus_prefixwith|Somet,false->t|Some(Analysists),true->Analysis(List.mapts~f:(Analysis_config.with_error_estimation~bootstrap_trials:Analysis_config.default_bootstrap_trials))|Some(Display_column_),true->failwithf"Cannot compute error estimate for %s."col()|None,_->failwithf"Invalid column name: %s"col()intletarg=Command.Param.Arg_type.createof_string