This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bench n size combine = | |
let plist = | |
let rec loop acc i v = | |
if i = 0 | |
then acc | |
else | |
let acc' = (v, string_of_int v ) :: acc in | |
loop acc' (i-1) (v+1) | |
in | |
loop [] size 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bench n size split = | |
let plist = | |
let rec loop acc i v = | |
if i = 0 | |
then acc | |
else | |
let acc' = (v, string_of_int v ) :: acc in | |
loop acc' (i-1) (v+1) | |
in | |
loop [] size 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bench n size split = | |
let plist = | |
let rec loop acc i v = | |
if i = 0 | |
then acc | |
else | |
let acc' = (v, string_of_int v ) :: acc in | |
loop acc' (i-1) (v+1) | |
in | |
loop [] size 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module String = struct | |
include String | |
let show (t:string) = Printf.sprintf "%S" t | |
let pp formatter t = | |
Format.pp_print_string formatter t | |
end | |
module type E = sig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
echo $(gcc --version) | |
VERSION=3.12 | |
shared_lib_file="/usr/local/lib/librocksdb.so.${VERSION}" | |
if [ -e $shared_lib_file ]; then | |
echo "$shared_lib_file exists" | |
else | |
echo "cloning, building, installing rocksdb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
echo $(g++ --version) | |
shared_lib_file="/usr/local/lib/librocksdb.so" | |
if [ -e $shared_lib_file ]; then | |
echo "$shared_lib_file exists" | |
else | |
echo "cloning, building, installing rocksdb" | |
git clone https://github.com/facebook/rocksdb/ | |
cd rocksdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Lwt | |
let do_something i = | |
let x = Random.int 100 in | |
Lwt_io.printlf "%i: x = %i" i x >>= fun () -> | |
if (x < 2) | |
then Lwt.fail (Failure "kaboom") | |
else Lwt.return () | |
let rec loop1 i = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sink (a,f) = f a | |
let base = () | |
let finish () = () | |
let step () = () | |
let fold (a,f) g = g (a,f) | |
let step0 h (a,f) = fold (h a,f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Lwt | |
let n = 1_000_000_000 | |
let time f = | |
let t0 = Unix.gettimeofday () in | |
let a = f () in | |
let t1 = Unix.gettimeofday () in | |
a,(t1-.t0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ('k,'v) msg = | |
| Insert of 'k * 'v | |
| Delete of 'k | |
let key = function | |
| Insert (k,_) -> k | |
| Delete k -> k | |
type ('k,'v) row = |
NewerOlder