package jupyter
An OCaml kernel for Jupyter notebook
Install
Dune Dependency
Authors
Maintainers
Sources
jupyter-2.8.3.tbz
sha256=1db1bb6fd1e9f2bafb7b038a7a98a351f67a1d25df2ecdb94115c6f94e5cccf5
doc/jupyter.notebook/Jupyter_notebook/Bench/index.html
Module Jupyter_notebook.Bench
Source
Benchmark functions
Types
Source
type 'a t = {
b_rtime : 'a;
(*Real time for the process
*)b_utime : 'a;
(*User time for the process
*)b_stime : 'a;
(*System time for the process
*)
}
The type of execution time of functions or code snippets.
'a
is float
or stat
.
Source
type stat = {
bs_mean : float;
(*Mean of execution time per a loop
*)bs_std : float;
(*Standard deviation of execution time per a loop
*)
}
The type of summary results of repeated measurement of execution time.
Benchmark
Source
val timeit :
?runs:int ->
?loops_per_run:int ->
?before_run:(unit -> unit) ->
?after_run:(unit -> unit) ->
(unit -> 'a) ->
stat t
timeit ?runs ?loops_per_run ?before_run ?after_run f
repeatedly executes a function f
, and measures the mean and the standard deviation of each execution time of f ()
.
for i = 1 to runs do
before_run () ;
(* --- start measurement of execution time of each run --- *)
for _ = 1 to loops_per_run do
ignore (f ()) ;
done ;
(* --- finish measurement --- *)
after_run () ;
done
timeit
is inspired by timeit package in Python. The parameter loops_per_run
, before_run
are named as number
, setup
respectively in Python.
Pretty printers
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page