Skip to content

Commit

Permalink
Add benchmark on US AZ (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Jun 18, 2023
1 parent 0a716a0 commit f950ef3
Show file tree
Hide file tree
Showing 4 changed files with 1,728 additions and 3 deletions.
87 changes: 87 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ keywords = ["geometry"]
[dependencies]

float_next_after = "1.0.0"

[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
lazy_static = "1.4.0"
12 changes: 9 additions & 3 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#![feature(test)]
#[cfg(test)]

mod benches_polygon {
use geometry_rs;
extern crate test;
use test::Bencher;
#[bench]
fn poly_contain_point(b: &mut Bencher) {

fn load_polygon() -> geometry_rs::Polygon{
let poly = geometry_rs::Polygon::new(
vec![
geometry_rs::Point {
Expand All @@ -31,7 +32,12 @@ mod benches_polygon {
],
vec![],
);

return poly;
}

#[bench]
fn poly_contain_point(b: &mut Bencher) {
let poly = load_polygon();

let p_in = geometry_rs::Point {
x: 99.9804504129416,
Expand Down
Loading

0 comments on commit f950ef3

Please sign in to comment.