Closed mmp closed 2 weeks ago
Starting point from http://localhost:6502/debug/pprof/profile?seconds=30
; duration 30s, 25s of samples
This so far brings us down to 5.73s in and under STARSPane Draw, or a 3.07x speedup overall. Probably good enough for now, though when the datablock formatting code gets its next rewrite, we should probably just cache the datablock text.
If you launch e.g. the Socal Combined scenario and let it run for a while (so, tons of aircraft), CPU usage is around 100% on my system here. Looking at a profile, there are a bunch of culprits in the STARS code that shouldn't be so dominant:
Part of the datablock-related cost is that both drawLeaderLines() and drawDatablocks() ends up calling formatDatablocks(). Perhaps datablocks should just be cached in STARSAircraftState and only updated when we get a new track.