Skip to content

Python tool for aircraft Doppler audio geolocation using historical ADS-B flight data (Source-available)

Reduce repeated flight decoding with a bounded 128 MiB cache (#304)

Cinna Davis470b7084a9d5
diff --git a/docs/DATA_AND_SCALE.md b/docs/DATA_AND_SCALE.md
index 73421c6..ae35021 100644
--- a/docs/DATA_AND_SCALE.md
+++ b/docs/DATA_AND_SCALE.md
@@ -29,6 +29,15 @@ verified original payload. This reduces first-use cache construction without
changing source coverage or filtering aircraft. `FlightIndex.prepare` also accepts
`prepare_scope=(bounds_wsen, time_range_s)` for an explicitly scoped index copy.
+Decoded tracks also have a bounded 128 MiB serialized cache per index per worker,
+with at most 2,048 entries. `FlightIndex(track_cache_bytes=...)` accepts a smaller
+limit or zero; cached queries still verify source payloads and return independent
+objects. On a real Kane County tile with 580 tracks and 1,337 associations, six
+alternating warm replays reduced median CPU from 5.486 to 5.212 seconds versus
+32 MiB, preserving the complete payload and retention checksum. This trades up to
+96 MiB more storage per index per worker for less decoding; the measured 5.0%
+reduction is specific to this tile, not an end-to-end or national estimate (#303).
+
The on-disk SQLite index has spatial and time indexes, source hashes, explicit
source scope, per-payload checksums and altitude/classification labels. Disk staging supports
arbitrary input order. Query predicates select whole gap-split segments; they
diff --git a/src/dopplergeist/data_access.py b/src/dopplergeist/data_access.py
index 8450b92..92d863e 100644
--- a/src/dopplergeist/data_access.py
+++ b/src/dopplergeist/data_access.py
@@ -506,7 +506,7 @@ class FlightIndex:
Concurrent queries use separate SQLite connections and return independent
tracks, even when they reuse the same verified snapshot.
"""
- def __init__(self, path, *, track_cache_bytes=32 * 1024 * 1024):
+ def __init__(self, path, *, track_cache_bytes=128 * 1024 * 1024):
if type(track_cache_bytes) is not int or track_cache_bytes < 0:
raise ValueError("Track cache size must be a nonnegative integer")
self.path = Path(path)