Benchmark suite for comparing language performance across Hemlock, HemlockC, C, Python, and JavaScript.
- fib - Recursive Fibonacci (CPU-bound, function call overhead)
- array_sum - Sum large array (memory access, iteration)
- string_concat - String concatenation (allocation, GC pressure)
- primes_sieve - Sieve of Eratosthenes (array access, loops)
- hash_table - Hash table insert/lookup/delete (dictionary operations)
- quicksort - Quicksort algorithm (recursion, array manipulation)
- merge_sort - Merge sort algorithm (recursion, array copying)
- binary_tree - Binary search tree insert and traversal (object allocation, recursion)
- graph_bfs - Breadth-first search on graph (queue operations, adjacency list traversal)
- matrix_multiply - Matrix multiplication (2D arrays, nested loops, floating point)
- json_serialize - JSON serialization (object creation, string building)
- json_deserialize - JSON parsing (string parsing, object creation)
- hash_sha256 - SHA-256 hashing (bitwise operations, loops, array manipulation)
- http_test - HTTP request/response building and parsing (string operations)
./run.sh # Run all benchmarks
./run.sh fib # Run specific benchmark
./run.sh --quick # Quick mode (smaller inputs)Results are output as JSON for easy comparison and visualization.
- Create implementations in
benchmarks/<name>/for each language - Add benchmark config to
benchmarks.json - Run
./run.sh <name>to test