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 d864c23
Show file tree
Hide file tree
Showing 11 changed files with 3,342 additions and 1,098 deletions.
30 changes: 26 additions & 4 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
# 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) |
| PDF | ![](https://raw.githubusercontent.com/ringsaturn/tzf-rs/main/assets/pdf.svg) |
| Regression | ![](https://raw.githubusercontent.com/ringsaturn/tzf-rs/main/assets/regression.svg) |

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.
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.
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 d864c23

Please sign in to comment.