Execution — How to Build and Run
Quick start (per language)
# Rust
cd src/rust
cargo build --release
cargo test --release
./target/release/dsbench --help
# Go
cd src/go
go test ./...
go build -o bin/dsbench ./cmd/dsbench
./bin/dsbench --help
# C++
cd src/cpp
cmake -S . -B build && cmake --build build
ctest --test-dir build
./build/dsbench --help
CLI: dsbench
A single binary per language that exercises both data structures.
| Subcommand | Args | What it does |
|---|---|---|
skiplist insert N [seed] | N (count) | Inserts N keys, prints final size + max level + histogram |
skiplist roundtrip N | N | Inserts N keys, verifies every key reads back, then removes them |
skiplist iter N | N | Inserts N random keys, prints all keys in iterator order |
hashtable insert N | N | Inserts N keys, reports load factor + max probe distance + histogram |
hashtable roundtrip N | N | Insert + verify + delete + verify gone |
bench point N | N | Inserts N keys into both, benchmarks point lookups for each |
bench mem N | N | Reports bytes-per-entry for both structures |
Library API
Same shape in all three languages.
SkipList::new(seed) -> SkipList
SkipList::insert(key, value) -> bool (true if newly inserted, false if replaced)
SkipList::get(key) -> Option<value>
SkipList::remove(key) -> bool
SkipList::len() -> usize
SkipList::iter() -> sorted iterator over (key, value)
HashTable::new(capacity) -> HashTable
HashTable::insert(key, value) -> bool
HashTable::get(key) -> Option<value>
HashTable::remove(key) -> bool
HashTable::len() -> usize
HashTable::load_factor() -> f64
HashTable::max_probe() -> usize
Keys and values are byte strings.
Verifying
./scripts/verify.sh # invariants per structure
./scripts/cross_test.sh # cross-language behavioral checks