Skip to content

Commit 26e40ac

Browse files
committed
benchmark: clarify reference
1 parent e712d9c commit 26e40ac

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

benchmark/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Benchmark
2+
3+
This directory benchmarks multiple S3 client implementations by lowering them all to a shared C ABI and loading them as shared libraries at runtime
4+
5+
The idea is:
6+
7+
- each implementation exports the same symbols, currently `initClient` and `get_object`
8+
- each implementation is compiled into its own shared library in `build/`
9+
- the host test/benchmark code loads those libraries with `dlopen`/`dlsym`
10+
- once everything looks the same at the ABI boundary, the host can exercise all implementations uniformly
11+
12+
This keeps the benchmark harness language-agnostic. The host does not need to know whether the underlying implementation was written in C++, Go, or something else. It only cares that the shared library exports the expected symbols with the expected ABI.
13+
14+
## Prerequisite
15+
16+
A local MinIO instance is expected to be running already. The current `test.cpp` uses `s3cpp` itself as a preamble to create basic scaffolding for the tests before calling each shared library implementation.
17+
18+
## Usage
19+
20+
Build all currently enabled shared libraries:
21+
22+
```bash
23+
make
24+
```
25+
26+
Tests that shared libraries are built:
27+
```bash
28+
make test
29+
./build/test
30+
```
31+
32+
## Notes
33+
34+
- Benchmark infra is inspired by @strager work [Faster than Rust and C++: the PERFECT hash table](https://www.youtube.com/watch?v=DMQ_HcNSOAI) video ([code](https://github.com/strager/perfect-hash-tables))

0 commit comments

Comments
 (0)