Skip to content

Commit eb3ecfc

Browse files
authored
Upgrade maxminddb in benchmarks to 0.27.2 (#10)
running 4 tests test tests::bench_city ... bench: 872.83 ns/iter (+/- 43.02) test tests::bench_city_oschwald ... bench: 748.95 ns/iter (+/- 16.51) test tests::bench_country ... bench: 468.07 ns/iter (+/- 22.21) test tests::bench_country_oschwald ... bench: 399.45 ns/iter (+/- 11.90)
1 parent 30537c9 commit eb3ecfc

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ members = [".", "codegen"]
2727
geoip2-codegen = { path = "codegen" }
2828

2929
[dev-dependencies]
30-
maxminddb = "0.24.0"
30+
maxminddb = "0.27.2"
3131

3232
[profile.release]
3333
lto = "fat"

benches/geoip.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ mod tests {
3232
let reader = maxminddb::Reader::open_readfile("./testdata/GeoIP2-Country.mmdb").unwrap();
3333
let ip = IpAddr::from_str("81.2.69.142").unwrap();
3434
b.iter(|| {
35-
reader.lookup::<maxminddb::geoip2::Country>(ip).unwrap();
35+
reader
36+
.lookup(ip)
37+
.unwrap()
38+
.decode::<maxminddb::geoip2::Country>()
39+
.unwrap();
3640
});
3741
}
3842

@@ -41,7 +45,11 @@ mod tests {
4145
let reader = maxminddb::Reader::open_readfile("./testdata/GeoIP2-City.mmdb").unwrap();
4246
let ip = IpAddr::from_str("81.2.69.142").unwrap();
4347
b.iter(|| {
44-
reader.lookup::<maxminddb::geoip2::City>(ip).unwrap();
48+
reader
49+
.lookup(ip)
50+
.unwrap()
51+
.decode::<maxminddb::geoip2::City>()
52+
.unwrap();
4553
});
4654
}
4755
}

0 commit comments

Comments
 (0)