Commit 29b01c2
A focused trip's shape was cached twice under the same shapeId with divergent
policies: TripObservationRepository's ShapeCache (Polyline, LRU 100, no TTL —
GTFS shapes are immutable) and FocusedTripRepository.shapeCache (decoded
List<GeoPoint>, LRU 32, with an unexplained 10-minute TTL on immutable data).
ensureShape() already returns the shared, deduped Polyline (coalescing the
network fetch via its own SingleFlight), so the decoded cache was a redundant
second copy (~2x memory, a second eviction policy, and the stray TTL). Drop it
and decode on demand from the shared Polyline cache; the Location -> GeoPoint
map is cheap and runs on a focus change, not the per-frame path. The fetch
concurrency throttle (shapePermits) and same-shape decode coalescing
(shapeFetches) are unchanged.
The cross-call shape memo now lives entirely in TripObservationRepository
(covered by TripObservationRepositoryTest); reframe the FocusedTripRepository
test that asserted its own memo to document the delegation.
Part of #1908 (finding 8, item 2).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ac3e7c2 commit 29b01c2
2 files changed
Lines changed: 18 additions & 8 deletions
File tree
- onebusaway-android/src
- main/java/org/onebusaway/android/map
- test/java/org/onebusaway/android/map
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
206 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
207 | 211 | | |
208 | | - | |
209 | | - | |
| 212 | + | |
| 213 | + | |
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
214 | | - | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
| |||
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
0 commit comments