Skip to content

Commit

Permalink
Add benchmark results to the README page (#42)
Browse files Browse the repository at this point in the history
This patch updates README page with benchmark results.
  • Loading branch information
ybubnov authored Oct 21, 2024
1 parent 4ff7e98 commit e82dacd
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ points = torch.rand((100, 2))
simplices = shull2d(simplices)
```

## Benchmarks

Benchmarks are collected on _Apple M1 Pro_ chip with 32 GiB of memory.

| Prob. Distribution | Data Type | Samples | Time | CPU | Iterations |
| ------------------ | --------- | ------- | -------- | -------- | ---------- |
| Uniform | Float64 | 10000 | 4.18 ms | 4.11 ms | 171 |
| Uniform | Float64 | 100000 | 49.6 ms | 48.3 ms | 15 |
| Uniform | Float64 | 1000000 | 600 ms | 592 ms | 1 |
| Uniform | Float32 | 10000 | 4.37 ms | 4.29 ms | 161 |
| Uniform | Float32 | 100000 | 47.4 ms | 46.4 ms | 15 |
| Uniform | Float32 | 1000000 | 573 ms | 568 ms | 1 |
| Normal | Float64 | 10000 | 4.60 ms | 4.49 ms | 156 |
| Normal | Float64 | 100000 | 48.5 ms | 47.4 ms | 15 |
| Normal | Float64 | 1000000 | 568 ms | 563 ms | 1 |
| Normal | Float32 | 10000 | 4.42 ms | 4.33 ms | 165 |
| Normal | Float32 | 100000 | 46.5 ms | 45.4 ms | 15 |
| Normal | Float32 | 1000000 | 550 ms | 547 ms | 1 |

## License

The Torch Delaunay is distributed under GPLv3 license. See the [LICENSE](LICENSE) file for full
Expand Down
42 changes: 40 additions & 2 deletions benchmark/sweephull_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,53 @@ benchmark_shull2d_uniform_float32(benchmark::State& state)
}


static void
benchmark_shull2d_normal_float64(benchmark::State& state)
{
auto options = torch::TensorOptions().dtype(torch::kFloat64).device(torch::kCPU);
auto points = torch::randn({state.range(0), 2}, options);

for (auto _ : state) {
shull2d(points);
}
}


static void
benchmark_shull2d_normal_float32(benchmark::State& state)
{
auto options = torch::TensorOptions().dtype(torch::kFloat32).device(torch::kCPU);
auto points = torch::randn({state.range(0), 2}, options);

for (auto _ : state) {
shull2d(points);
}
}


BENCHMARK(benchmark_shull2d_uniform_float64)
->Arg(1000)
->Arg(10000)
->Arg(100000)
->Arg(1000000)
->Unit(benchmark::kMillisecond);


BENCHMARK(benchmark_shull2d_uniform_float32)
->Arg(1000)
->Arg(10000)
->Arg(100000)
->Arg(1000000)
->Unit(benchmark::kMillisecond);


BENCHMARK(benchmark_shull2d_normal_float64)
->Arg(10000)
->Arg(100000)
->Arg(1000000)
->Unit(benchmark::kMillisecond);


BENCHMARK(benchmark_shull2d_normal_float32)
->Arg(10000)
->Arg(100000)
->Arg(1000000)
->Unit(benchmark::kMillisecond);
Expand Down

0 comments on commit e82dacd

Please sign in to comment.