[dependencies]
geoip2 = "0.1.8"See examples/lookup.rs for a basic example.
Benchmarks required nightly Rust.
Place GeoIP2-Country.mmdb and GeoIP2-City.mmdb in the testdata folder, then run:
cargo bench
Tested on paid DB on cargo 1.95.0-nightly, Ryzen 5 3600, Ubuntu 20.04.3 LTS.
default
city 1,782.38 ns/iter (+/- 28.49)
country 908.45 ns/iter (+/- 7.62)
unsafe-str
city 999.06 ns/iter (+/- 8.87)
country 467.06 ns/iter (+/- 5.79)
oschwald/maxminddb-rust 0.27.2.
default
city 1,915.71 ns/iter (+/- 29.17)
country 993.89 ns/iter (+/- 47.24)
simdutf8
city 1,870.60 ns/iter (+/- 32.75)
country 960.99 ns/iter (+/- 22.91)
unsafe-str-decode
city 1,708.32 ns/iter (+/- 27.23)
country 875.96 ns/iter (+/- 44.86)