Skip to content

Commit

Permalink
update batches with Option and any
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Apr 15, 2024
1 parent c13ccd2 commit f1dd01e
Show file tree
Hide file tree
Showing 5 changed files with 100,091 additions and 100,061 deletions.
54 changes: 37 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,34 +138,54 @@ The benchmarks tests 3 different implementations of a proxy database

The benchmarks are created by:

1. running `just bench`
2. copying the output into [./scripts/plot_bench_charts](./scripts/plot_bench_charts.py) and running it
1. running `just bench`;
2. copying the output into [./scripts/plot_bench_charts](./scripts/plot_bench_charts.py) and running it.

Snippet that is ran for each 3 implementations:

```rust,ignore
fn test_db(db: &impl ProxyDB) {
let i = next_round();
let pool = POOLS[i % POOLS.len()];
let country = COUNTRIES[i % COUNTRIES.len()];
let result = db.get(i as u64);
divan::black_box(result);
let result = db.any_tcp(pool, country);
divan::black_box(result);
let result = db.any_socks5_isp(pool, country);
divan::black_box(result);
}
```

### Benchmark Performance Results

Performance for Database with `100` records:

| Proxy DB | Fastest (µs) | Median (µs) | Slowest (µs) |
| --- | --- | --- | --- |
| naive_proxy_db_100 | 6.87 | 7.48 | 19.16 |
| sql_lite_proxy_db_100 | 34.16 | 36.33 | 78.04 |
| venn_proxy_db_100 | 0.92 | 0.99 | 8.50 |
| naive_proxy_db_100 | 6.50 | 8.00 | 18.04 |
| sql_lite_proxy_db_100 | 32.58 | 37.37 | 302.00 |
| venn_proxy_db_100 | 0.89 | 0.92 | 2.74 |

Performance for Database with `12_500` records:

| Proxy DB | Fastest (µs) | Median (µs) | Slowest (µs) |
| --- | --- | --- | --- |
| naive_proxy_db_12_500 | 402.20 | 407.60 | 434.30 |
| sql_lite_proxy_db_12_500 | 1099.00 | 1182.00 | 1519.00 |
| venn_proxy_db_12_500 | 16.79 | 17.54 | 23.16 |
| naive_proxy_db_12_500 | 404.00 | 407.70 | 478.70 |
| sql_lite_proxy_db_12_500 | 1061.00 | 1073.00 | 1727.00 |
| venn_proxy_db_12_500 | 16.04 | 16.97 | 25.54 |

Performance for Database with `100_000` records:

| Proxy DB | Fastest (µs) | Median (µs) | Slowest (µs) |
| --- | --- | --- | --- |
| naive_proxy_db_100_000 | 3769.00 | 3882.00 | 5285.00 |
| sql_lite_proxy_db_100_000 | 8334.00 | 8628.00 | 10070.00 |
| venn_proxy_db_100_000 | 128.30 | 136.50 | 152.10 |
| naive_proxy_db_100_000 | 3790.00 | 3837.00 | 5731.00 |
| sql_lite_proxy_db_100_000 | 8219.00 | 8298.00 | 9424.00 |
| venn_proxy_db_100_000 | 124.20 | 129.20 | 156.30 |

We are not database nor hardware experts though. Please do open an issue if you think
these benchmarks are incorrect or if related improvements can be made.
Expand All @@ -179,24 +199,24 @@ Allocations for Database with `100` records:

| Proxy DB | Fastest (KB) | Median (KB) | Slowest (KB) |
| --- | --- | --- | --- |
| naive_proxy_db_100 | 0.38 | 0.38 | 0.38 |
| sql_lite_proxy_db_100 | 4.53 | 4.53 | 4.53 |
| naive_proxy_db_100 | 0.33 | 0.33 | 0.33 |
| sql_lite_proxy_db_100 | 4.04 | 4.04 | 4.04 |
| venn_proxy_db_100 | 0.05 | 0.05 | 0.05 |

Allocations for Database with `12_500` records:

| Proxy DB | Fastest (KB) | Median (KB) | Slowest (KB) |
| --- | --- | --- | --- |
| naive_proxy_db_12_500 | 40.22 | 40.22 | 40.22 |
| sql_lite_proxy_db_12_500 | 5.02 | 5.03 | 5.03 |
| naive_proxy_db_12_500 | 40.73 | 40.73 | 40.73 |
| sql_lite_proxy_db_12_500 | 5.03 | 5.02 | 5.03 |
| venn_proxy_db_12_500 | 3.15 | 3.15 | 3.15 |

Allocations for Database with `100_000` records:

| Proxy DB | Fastest (KB) | Median (KB) | Slowest (KB) |
| --- | --- | --- | --- |
| naive_proxy_db_100_000 | 324.00 | 324.00 | 324.00 |
| sql_lite_proxy_db_100_000 | 5.02 | 5.02 | 5.03 |
| naive_proxy_db_100_000 | 323.30 | 323.30 | 323.70 |
| sql_lite_proxy_db_100_000 | 5.02 | 5.02 | 5.01 |
| venn_proxy_db_100_000 | 25.02 | 25.02 | 25.02 |

We are not database nor hardware experts though. Please do open an issue if you think
Expand Down
Loading

0 comments on commit f1dd01e

Please sign in to comment.