Skip to content

IncSW/geoip2-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoIP2 Reader for Rust

This library reads MaxMind GeoIP2 databases

Build Status Software License Downloads

crates.io Documentation Dependency Status

Usage

[dependencies]
geoip2 = "0.1.8"

See examples/lookup.rs for a basic example.

Benchmarks

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)

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)

License

MIT License.

About

Fast GeoIP2 Reader for Rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages