项目作者: IncSW

项目描述 :
Fast GeoIP2 Reader for Rust
高级语言: Rust
项目地址: git://github.com/IncSW/geoip2-rs.git
创建时间: 2020-10-03T10:24:39Z
项目社区:https://github.com/IncSW/geoip2-rs

开源协议:MIT License

下载



GeoIP2 Reader for Rust



This library reads MaxMind GeoIP2 databases



Build Status
Software License
Downloads

crates.io
Documentation
Dependency Status


Usage

  1. [dependencies]
  2. geoip2 = "0.1.7"

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:

  1. cargo bench

Tested on paid DB on cargo 1.56.0-nightly, Intel i7-7700, Debian 9.1.

IncSW/geoip2-rs

default

  1. city 2,175 ns/iter (+/- 124)
  2. country 1,123 ns/iter (+/- 111)

unsafe-str

  1. city 1,113 ns/iter (+/- 76)
  2. country 524 ns/iter (+/- 31)

oschwald/maxminddb-rust.

default

  1. city 4,224 ns/iter (+/- 153)
  2. country 2,270 ns/iter (+/- 158)

unsafe-str-decode

  1. city 3,266 ns/iter (+/- 191)
  2. country 1,802 ns/iter (+/- 75)

License

MIT License.