No description
- HTML 91.5%
- Shell 6.3%
- OCaml 2%
- Makefile 0.2%
| .tools | ||
| docs | ||
| dune.lock | ||
| results | ||
| scripts | ||
| skills/oxcaml | ||
| .gitignore | ||
| dune | ||
| dune-project | ||
| dune-workspace | ||
| generate.ml | ||
| main.ml | ||
| Makefile | ||
| README.md | ||
Parsing 1B rows in Ocaml
Inspired by the 1 Billion Row Challenge in Java and 1brc by taekim in Bun/TypeScript, I wanted to implement it in OCaml (and try some of the OxCaml features).
Current best run (results/2026-03-14_20-23-25_136617877.txt):
- Total rows processed: 1,000,000,000
- Total time (wall clock): 3.49s
- Internal timer (Processed in): 0.87s
- Average throughput (wall clock): 286,532,951 rows/second
System specs
- OS: Linux 6.12.22+bpo-amd64 (
x86_64) - CPU: 2x AMD EPYC 9755 128-Core Processor (256 cores / 512 threads)
- Memory: 2.2TiB RAM
- OCaml: 5.2.0+ox
- Dune: 3.21.1
Instructions
Step 0: Use dune pkg manager
Install dune 3.21.1
Step 1: Create the file with 1 billion rows
Install dependencies, this project is configured to work with OxCaml (OCaml 5.2.0+ox).
make install
Generate the measurements file:
make generate
NOTE: file is about 13.8GB (data/measurements.txt), make sure you have enough space.
Step 2: Run the parser
Build the project:
make build
Run it on a test file first:
dune exec ./main.exe -- data/small.txt
Run it on measurements.txt (the 13.8GB file):
/usr/bin/time -v dune exec ./main.exe -- data/measurements.txt