Skip to content

Instantly share code, notes, and snippets.

@hoichi hoichi/Benchmark.ml
Created Sep 7, 2018

Embed
What would you like to do?
Benchmarking in OCaml
#require "core_bench";;
open Core_bench;;
[ Bench.Test.create ~let numbers = List.range 0 1000 in
[ Bench.Test.create ~name:"sum_if" (fun () -> ignore (sum_if numbers))
; Bench.Test.create ~name:"sum" (fun () -> ignore (sum numbers)) ]
|> Bench.bench
;;
(* from https://dev.realworldocaml.org/lists-and-patterns.html#performance *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.