| Crates.io | geoip2 |
| lib.rs | geoip2 |
| version | 0.1.7 |
| created_at | 2021-08-21 10:03:45.431484+00 |
| updated_at | 2024-03-26 15:53:29.331848+00 |
| description | Library for reading MaxMind DB format used by GeoIP2 and GeoLite2 |
| homepage | https://github.com/IncSW/geoip2-rs |
| repository | https://github.com/IncSW/geoip2-rs |
| max_upload_size | |
| id | 440270 |
| size | 52,933 |
[dependencies]
geoip2 = "0.1.6"
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.56.0-nightly, Intel i7-7700, Debian 9.1.
default
city 2,175 ns/iter (+/- 124)
country 1,123 ns/iter (+/- 111)
unsafe-str
city 1,113 ns/iter (+/- 76)
country 524 ns/iter (+/- 31)
default
city 4,224 ns/iter (+/- 153)
country 2,270 ns/iter (+/- 158)
unsafe-str-decode
city 3,266 ns/iter (+/- 191)
country 1,802 ns/iter (+/- 75)