Skip to content

Commit

Permalink
Update benchmark
Browse files Browse the repository at this point in the history
runs on Apple M3 Max
  • Loading branch information
ringsaturn committed Nov 11, 2024
1 parent c581968 commit 8382bf5
Show file tree
Hide file tree
Showing 13 changed files with 3,344 additions and 1,100 deletions.
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,36 @@ That's all. There are no black magic tricks inside the tzf-rs.
Below is a benchmark run on global cities(about 14K), and avg time is about
3,000 ns per query:

```txt
test benches_default::bench_default_finder_random_city ... bench: 2,870 ns/iter (+/- 182)
```rust,ignore
// require toolchain.channel=nightly
#![feature(test)]
#[cfg(test)]
mod benches_default {
use tzf_rs::DefaultFinder;
extern crate test;
use test::Bencher;
#[bench]
fn bench_default_finder_random_city(b: &mut Bencher) {
let finder: DefaultFinder = DefaultFinder::default();
b.iter(|| {
let city = cities_json::get_random_cities();
let _ = finder.get_tz_name(city.lng, city.lat);
});
}
}
```

```console
test benches_default::bench_default_finder_random_city ... bench: 1,220.19 ns/iter (+/- 54.36)
```

| Criterion result | Pic |
| ---------------- | ----------------------------------------------------------------------------------------- |
| PDF | ![](https://raw.githubusercontent.com/ringsaturn/tzf-rs/main/assets/pdf_small.svg) |
| Regression | ![](https://raw.githubusercontent.com/ringsaturn/tzf-rs/main/assets/regression_small.svg) |
| Criterion result | Pic |
| ---------------- | ------------------------------------------------------------------------------------------ |
| PDF | ![](https://raw.githubusercontent.com/ringsaturn/tzf-rs/main/assets/pdf_small.webp) |
| Regression | ![](https://raw.githubusercontent.com/ringsaturn/tzf-rs/main/assets/regression_small.webp) |

You can view more details from latest benchmark from
[GitHub Actions logs](https://github.com/ringsaturn/tzf-rs/actions/workflows/rust.yml).
Expand Down
394 changes: 307 additions & 87 deletions assets/MAD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
376 changes: 297 additions & 79 deletions assets/SD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
384 changes: 297 additions & 87 deletions assets/mean.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
375 changes: 292 additions & 83 deletions assets/median.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
460 changes: 318 additions & 142 deletions assets/pdf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
262 changes: 203 additions & 59 deletions assets/pdf_small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pdf_small.webp
Binary file not shown.
696 changes: 485 additions & 211 deletions assets/regression.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
659 changes: 463 additions & 196 deletions assets/regression_small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/regression_small.webp
Binary file not shown.
402 changes: 327 additions & 75 deletions assets/slope.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
402 changes: 327 additions & 75 deletions assets/typical.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8382bf5

Please sign in to comment.