maxmind-db-rust 0.2.1-x86_64-linux → 0.3.0-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +30 -28
- data/lib/maxmind/db/3.2/maxmind_db_rust.so +0 -0
- data/lib/maxmind/db/3.3/maxmind_db_rust.so +0 -0
- data/lib/maxmind/db/3.4/maxmind_db_rust.so +0 -0
- data/lib/maxmind/db/4.0/maxmind_db_rust.so +0 -0
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44b50a29eb78c0c9608b6564b399f7a51ea2d29d9add9459777a97d751c743c3
|
|
4
|
+
data.tar.gz: 45073904effcde088115cb014f0657e4180029ad0fa5a36b68456339859087f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a9ae58533538efb220195f02f032fcfe2d7bec6268a2b42cac27f4f9bb123842cf7b97efde6b215689da146ef5187e342904f77d90cdf68530e1e570b1d1473
|
|
7
|
+
data.tar.gz: afab743a497847dfbd794d78366cbb89385bd221e30322471be67b981af4f0d051869933d7259241ef58d0038068fbdd13d7375a362d7d8ca7fe27a0577751c5
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.0] - 2026-02-22
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Improved lookup performance by using a generic bounded key cache for decoded map keys.
|
|
13
|
+
- Improved `IPAddr` lookup performance by decoding packed bytes from `IPAddr#hton` directly.
|
|
14
|
+
- Switched map-key cache hashing to `FxHashMap` for faster key-cache access.
|
|
15
|
+
- Switched map-key cache roots to a Ruby-owned cache array with Rust key-to-index lookups.
|
|
16
|
+
- Refactored duplicated prefix and `within` decode paths in the Rust reader for simpler maintenance.
|
|
17
|
+
- Refactored duplicate database file-open error handling shared by MMAP and MEMORY modes.
|
|
18
|
+
- Updated Rust and Ruby dependencies.
|
|
19
|
+
- Added Ruby 4.0 coverage to CI workflows.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Made extension initialization idempotent across `MaxMind::DB` class/module loading modes to avoid typed-data incompatibility when the extension is loaded more than once.
|
|
24
|
+
- When loaded with the official `MaxMind::DB` class, `MaxMind::DB::Rust` now uses anonymous module creation to preserve canonical module naming.
|
|
25
|
+
- Scoped Rust dependency cache per Ruby version in CI tests and stopped caching `target/` in the test workflow to avoid cross-version artifact contamination.
|
|
26
|
+
|
|
8
27
|
## [0.2.1] - 2025-12-18
|
|
9
28
|
|
|
10
29
|
### Changed
|
data/README.md
CHANGED
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
[](https://github.com/oschwald/maxmind-db-rust-ruby/actions/workflows/test.yml)
|
|
4
4
|
[](https://github.com/oschwald/maxmind-db-rust-ruby/actions/workflows/lint.yml)
|
|
5
5
|
|
|
6
|
-
A
|
|
6
|
+
A Ruby gem for reading MaxMind DB files, implemented in Rust.
|
|
7
|
+
It keeps the API close to the official `maxmind-db` gem while adding Rust-backed performance.
|
|
7
8
|
|
|
8
9
|
> **Note:** This is an unofficial library and is not endorsed by MaxMind. For the official Ruby library, see [maxmind-db](https://github.com/maxmind/MaxMind-DB-Reader-ruby).
|
|
9
10
|
|
|
10
11
|
## Features
|
|
11
12
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
13
|
+
- Rust implementation focused on fast lookups
|
|
14
|
+
- API modeled after the official `maxmind-db` gem
|
|
15
|
+
- Thread-safe lookups
|
|
16
|
+
- Supports MMAP and in-memory modes
|
|
17
|
+
- Includes network iteration support
|
|
18
|
+
- Accepts both `String` and `IPAddr` inputs
|
|
18
19
|
|
|
19
20
|
## Installation
|
|
20
21
|
|
|
@@ -277,30 +278,31 @@ Metadata attributes:
|
|
|
277
278
|
|
|
278
279
|
## Comparison with Official Gem
|
|
279
280
|
|
|
280
|
-
| Feature | maxmind-db (official) | maxmind-db-rust (this gem)
|
|
281
|
-
| ---------------- | --------------------- |
|
|
282
|
-
| Implementation | Pure Ruby | Rust with Ruby bindings
|
|
283
|
-
| Performance | Baseline |
|
|
284
|
-
| API | MaxMind::DB | MaxMind::DB::Rust
|
|
285
|
-
| MODE_FILE | ✓ | ✗
|
|
286
|
-
| MODE_MEMORY | ✓ | ✓
|
|
287
|
-
| MODE_AUTO | ✓ | ✓
|
|
288
|
-
| MODE_MMAP | ✗ | ✓
|
|
289
|
-
| Iterator support | ✗ | ✓
|
|
290
|
-
| Thread-safe | ✓ | ✓
|
|
281
|
+
| Feature | maxmind-db (official) | maxmind-db-rust (this gem) |
|
|
282
|
+
| ---------------- | --------------------- | ------------------------------------------ |
|
|
283
|
+
| Implementation | Pure Ruby | Rust with Ruby bindings |
|
|
284
|
+
| Performance | Baseline | Faster lookup throughput in our benchmarks |
|
|
285
|
+
| API | MaxMind::DB | MaxMind::DB::Rust |
|
|
286
|
+
| MODE_FILE | ✓ | ✗ |
|
|
287
|
+
| MODE_MEMORY | ✓ | ✓ |
|
|
288
|
+
| MODE_AUTO | ✓ | ✓ |
|
|
289
|
+
| MODE_MMAP | ✗ | ✓ |
|
|
290
|
+
| Iterator support | ✗ | ✓ |
|
|
291
|
+
| Thread-safe | ✓ | ✓ |
|
|
291
292
|
|
|
292
293
|
## Performance
|
|
293
294
|
|
|
294
|
-
|
|
295
|
+
Lookup performance depends on hardware, Ruby version, database, and workload.
|
|
295
296
|
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
297
|
+
- In this project’s random-lookup benchmarks, this gem is consistently faster than the official Ruby implementation.
|
|
298
|
+
- On `/var/lib/GeoIP/GeoIP2-City.mmdb` in this environment, random lookup throughput was about `47x` higher than the official gem.
|
|
299
|
+
- `MODE_MMAP` and `MODE_MEMORY` both perform well; which is faster can vary by environment.
|
|
300
|
+
- For reproducible numbers on your own data, run `benchmark/compare_lookups.rb` against your database.
|
|
301
|
+
- Safe for concurrent lookups across threads.
|
|
300
302
|
|
|
301
303
|
## Development
|
|
302
304
|
|
|
303
|
-
|
|
305
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for developer documentation, including:
|
|
304
306
|
|
|
305
307
|
- Development setup and prerequisites
|
|
306
308
|
- Building and testing the extension
|
|
@@ -321,11 +323,11 @@ bundle exec rake test
|
|
|
321
323
|
|
|
322
324
|
## Contributing
|
|
323
325
|
|
|
324
|
-
1. Fork
|
|
325
|
-
2. Create
|
|
326
|
-
3. Commit your changes (`git commit -am '
|
|
326
|
+
1. Fork the repository
|
|
327
|
+
2. Create a feature branch (`git checkout -b my-new-feature`)
|
|
328
|
+
3. Commit your changes (`git commit -am 'Describe your change'`)
|
|
327
329
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
328
|
-
5.
|
|
330
|
+
5. Open a Pull Request
|
|
329
331
|
|
|
330
332
|
## License
|
|
331
333
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maxmind-db-rust
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Gregory Oschwald
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '6.0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '6.0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -152,6 +152,7 @@ files:
|
|
|
152
152
|
- lib/maxmind/db/3.2/maxmind_db_rust.so
|
|
153
153
|
- lib/maxmind/db/3.3/maxmind_db_rust.so
|
|
154
154
|
- lib/maxmind/db/3.4/maxmind_db_rust.so
|
|
155
|
+
- lib/maxmind/db/4.0/maxmind_db_rust.so
|
|
155
156
|
- lib/maxmind/db/rust.rb
|
|
156
157
|
homepage: https://github.com/oschwald/maxmind-db-rust-ruby
|
|
157
158
|
licenses:
|
|
@@ -174,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
174
175
|
version: '3.2'
|
|
175
176
|
- - "<"
|
|
176
177
|
- !ruby/object:Gem::Version
|
|
177
|
-
version:
|
|
178
|
+
version: 4.1.dev
|
|
178
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
180
|
requirements:
|
|
180
181
|
- - ">="
|