Commit 92edee0
fer
perf(eccentricity): Add cached eccentricity with TNFR dependency tracking
PARADIGM ALIGNMENT:
- Eccentricity = topological invariant (only changes with structure)
- Cache preserves coherence (no redundant BFS reorganization traversals)
- Automatic invalidation via dependencies={'graph_topology'}
PERFORMANCE IMPACT:
- Total speedup: 6.138s → 1.707s (3.6× faster, 72% reduction)
- Eccentricity: 2.332s → 0.234s first call (10× faster)
- Cached calls: 0.000s (infinite speedup)
- Function calls: 14.6M → 6.3M (57% reduction)
IMPLEMENTATION:
- Add compute_eccentricity_cached() with @cache_tnfr_computation
- Integrate into validation aggregator with fallback path
- Dependencies: {'graph_topology'} ensures structural coherence
PROFILING EVIDENCE:
- Before: eccentricity 2.332s (60% of 3.838s)
- After: eccentricity 0.234s (14% of 1.707s, first call only)
- Current bottleneck: Φ_s computation 1.438s (reasonable for distance matrix)
Physics: Topological metrics cached per structural coupling invariants.
Refs: src/tnfr/utils/fast_diameter.py::compute_eccentricity_cached1 parent 26d119a commit 92edee0
2 files changed
+75
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
13 | 29 | | |
14 | 30 | | |
15 | 31 | | |
| |||
130 | 146 | | |
131 | 147 | | |
132 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
133 | 193 | | |
134 | 194 | | |
135 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| 232 | + | |
229 | 233 | | |
230 | 234 | | |
231 | | - | |
| 235 | + | |
| 236 | + | |
232 | 237 | | |
233 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
| |||
0 commit comments