maxmind-db-rust 0.2.1-aarch64-linux → 0.3.0-aarch64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3293e6f4fb7b779387b27788b54885f8b8ccc1d9ffb9187f1b5ce228fbbb4547
4
- data.tar.gz: ebddce8416986e40fdfcabba3d54c30dcd31df48731d70aa65fe93f84a4d44a5
3
+ metadata.gz: 5095227e690cb06e604d1d4639f4608a4e16122f2b57504d6c6040d0ac6a793e
4
+ data.tar.gz: 7a7d2f7b9dc467ae6a8c87824ac52274de722e6af7854ed1c5b44e326df0985c
5
5
  SHA512:
6
- metadata.gz: 5695b5aecf448c5177c0a53433766d769c7703accd32ef80465caa6e7a3ce975808f4cda05532df4311b5f92d46dd57c562d0fb72778cc5abbbd071894734b02
7
- data.tar.gz: 73e49cafc4ebcfeecc19259d66f192d4a720d5a2e2bb286214e5e82522a9ff0557a84b9159853b36477a8bc97fa514bcc4b046c241d262dbbc675f9c07f67acb
6
+ metadata.gz: f49fc1dcd0f5a426deda268a1b011a962c2dd81f240334441eb9b781a647325cc82c1b1c2e5d375801eb6cef7973441efcb22f14fef474a9017d25b7f35432c8
7
+ data.tar.gz: cccd40db4939a0d7fc4282b62254a273946b63431117c72e44e8f845d88904d761685dbfe2f174a0181fad38ccbe98f65406c663e2af7b3ce9ef87b13a36dce9
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
  [![Test](https://github.com/oschwald/maxmind-db-rust-ruby/actions/workflows/test.yml/badge.svg)](https://github.com/oschwald/maxmind-db-rust-ruby/actions/workflows/test.yml)
4
4
  [![Lint](https://github.com/oschwald/maxmind-db-rust-ruby/actions/workflows/lint.yml/badge.svg)](https://github.com/oschwald/maxmind-db-rust-ruby/actions/workflows/lint.yml)
5
5
 
6
- A high-performance Rust-based Ruby gem for reading MaxMind DB files. Provides API compatibility with the official `maxmind-db` gem while leveraging Rust for superior performance.
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
- - **High Performance**: Rust-based implementation provides significantly faster lookups than pure Ruby
13
- - **API Compatible**: Familiar API similar to the official MaxMind::DB gem
14
- - **Thread-Safe**: Safe to use from multiple threads
15
- - **Memory Modes**: Support for both memory-mapped (MMAP) and in-memory modes
16
- - **Iterator Support**: Iterate over all networks in the database (extension feature)
17
- - **Type Support**: Works with both String and IPAddr objects
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 | 10-50x faster |
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
- Expected performance characteristics (will vary based on hardware):
295
+ Lookup performance depends on hardware, Ruby version, database, and workload.
295
296
 
296
- - Single-threaded lookups: 300,000 - 500,000 lookups/second
297
- - Significantly faster than pure Ruby implementations
298
- - Memory-mapped mode (MMAP) provides best performance
299
- - Fully thread-safe for concurrent lookups
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
- Interested in contributing? See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed developer documentation, including:
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 it
325
- 2. Create your feature branch (`git checkout -b my-new-feature`)
326
- 3. Commit your changes (`git commit -am 'Add some feature'`)
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. Create a new Pull Request
330
+ 5. Open a Pull Request
329
331
 
330
332
  ## License
331
333
 
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.2.1
4
+ version: 0.3.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Gregory Oschwald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-18 00:00:00.000000000 Z
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: '5.0'
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: '5.0'
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: 3.5.dev
178
+ version: 4.1.dev
178
179
  required_rubygems_version: !ruby/object:Gem::Requirement
179
180
  requirements:
180
181
  - - ">="