Skip to content

v1.3.4

Choose a tag to compare

@github-actions github-actions released this 11 Jul 02:07
94b4d6f

v1.3.4

This release cuts DefaultFinder's memory footprint roughly in half — live heap drops from ~93 MB to ~43 MB on the bundled dataset — while making lookups faster. No public API is removed or changed; lookup results are identical to v1.3.3.

Highlights

FuzzyFinder: interned names and packed tile keys (#206)

The preindex HashMap<(i64, i64, i64), Vec<String>> is replaced with a compact layout mirroring the Go implementation:

  • One sorted name table; tiles reference timezone names by u16 index.
  • Per-tile entries stored as One(u16) / Many(Box<[u16]>), avoiding a heap allocation for the vast majority of tiles that belong to exactly one timezone.
  • (x, y, z) tile keys packed into a single u64, matching Go's geom.TileID layout.

Measured with the bundled dataset (release build):

  • Live heap held by FuzzyFinder: 15.2 MiB → 5.2 MiB (−66%)
  • Peak heap during load: 21.2 MiB → 12.7 MiB (−40%)
  • Lookup latency over 1M mixed coordinates: 178 ns/op → 118 ns/op (−34%)

Slimmer Y-stripes index (geometry-rs 0.4.2)

geometry-rs no longer stores per-segment y ranges (they are recomputed from segment endpoints during the raycast) and stores stripe entries as u32:

  • Y-stripes index memory: 42.0 MB → 11.0 MB (−74%)
  • Query time unchanged to slightly faster (~−8% on FinderIndexModes/YStripesOnly)

A counting-allocator probe (examples/index_memory_probe_alloc.rs) is included to reproduce these measurements per index mode.

Integer coordinate storage (geometry-rs 0.4.3)

The compressed-topology data is polyline-encoded at 1e5 precision — the source coordinates are already integers. Finder now stores ring points as scaled i32 pairs (8 bytes/point instead of 16) with no precision loss:

  • Finder live heap (YStripes mode): 46.9 MB → 38.3 MB
  • Better cache density on the point-in-polygon path

Two new FinderOptions variants control the raycast strategy over integer-stored coordinates: NoIndexFloatRaycast (convert endpoints to f64 in-register, the default behavior) and NoIndexIntegerRaycast (pure integer raycast). FinderOptions is #[non_exhaustive], so this is a non-breaking addition.

Combined effect (bundled dataset)

v1.3.3 v1.3.4
DefaultFinder live heap ~93 MB ~43 MB (−53%)
Finder (YStripes) live heap 78.0 MB 38.3 MB
FuzzyFinder live heap 15.2 MiB 5.2 MiB
FuzzyFinder lookup 178 ns/op 118 ns/op

Downstream check via tzfpy + tz-benchmark (macOS arm64, process RSS delta): 125.0 MiB → 77.4 MiB (−38%), random-city lookups −41%, boundary-region lookups −70%, with bit-for-bit identical accuracy results (154,694 cities + 23,408 edge points).

What's Changed

  • Reduce FuzzyFinder memory usage with interned names and packed tile keys by @ringsaturn in #206
  • Bump geometry-rs to 0.4.2 with slimmer YStripesIndex
  • Store compressed topology coordinates as integers (geometry-rs 0.4.3)
  • Bump serde_json from 1.0.149 to 1.0.150 in the dependencies group by @dependabot in #203
  • Bump actions/checkout from 6 to 7 in the dependencies group by @dependabot in #204
  • Bump the dependencies group with 4 updates by @dependabot in #205

Full Changelog: v1.3.3...v1.3.4