perf(cluster): rotate the grid cache instead of emptying it, cap 100k
The cache dropped EVERY entry once it passed 20 000. That was survivable while the only feed was this station's own WSJT-X decodes, which never reached the ceiling — it is a cliff for anything larger, and every locator in the cluster list would disappear at once, periodically, for no reason the operator could see. Two generations: when the current map fills it becomes the previous one and a fresh map takes over; lookups consult both. A rotation therefore costs the older half and nothing more. It needs no insertion order, no per-entry timestamp and no bookkeeping on the write path — all of which "evict the oldest thousand" would require, on a path that runs once per decode. The cap is 100 000, measured at 82 bytes an entry: 8 MB a generation, 16 MB for both. 20 000 was chosen when the ceiling was unreachable anyway. Both maps now go through rememberDecodeGrid / lookupDecodeGrid. Rotation swaps the map headers, so the read had to be guarded; routing every access through one accessor is what makes that checkable rather than remembered.
This commit is contained in:
+6
-2
@@ -2,8 +2,12 @@
|
||||
{
|
||||
"version": "0.24.8",
|
||||
"date": "",
|
||||
"en": [],
|
||||
"fr": []
|
||||
"en": [
|
||||
"Cluster: the grid cache now holds 100,000 callsigns and rotates instead of emptying itself, so locators stop vanishing from the list."
|
||||
],
|
||||
"fr": [
|
||||
"Cluster : le cache de locators garde 100 000 indicatifs et tourne au lieu de se vider, les locators ne disparaissent donc plus de la liste."
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.24.7",
|
||||
|
||||
Reference in New Issue
Block a user