Closed jocopa3 closed 1 year ago
Removed the memory usage debug display. It's not a measure of how much memory shortest-path uses, but rather a rough measure of how much memory was allocated across the entire game while pathfinding was running (assuming no GC took place in that time). Because of this it's a gross over-estimation of memory usage and not a relevant metric. I wouldn't want users being misled into thinking shortest-path is eating up memory because some other plugin in the background is leaking a ton of memory.
New panel looks like:
What do you think of only showing the debug panel if the --debug
argument has been passed to the client?
What do you think of only showing the debug panel if the --debug argument has been passed to the client?
If it's something you'd prefer I can change it to toggle only during development/debugging. Included it as an option in-case there's info that'd be helpful in narrowing down bug reports and issues but it's also not too useful to most people outside of being interesting stats to look at.
For simplicity for developers I think you should leave it as a config option like you intended.
I just remembered issue #26 where someone accidentally turned on Draw transports
and did not know how to remove it again.
Opted to move the panel toggle to a "Debug Options" section to make it clearer to people that it's probably not something they need to toggle. Hopefully that along with the panel title being "Shortest Path Debug" make it obvious what it is and how to turn it off if needed.
Stress tested plugin stability by spam-clicking options on/off and turning the plugin itself on/off quickly. After a fixing a few breaks/exceptions, the plugin seems to be fully stable.
Debug Panel
DebugOverlayPanel
with basic stats about path findingrough approximation of memory usedAdded a warning for users that memory usage is not 100% accurate and may be off by ±5MB in the worst caseMemory info will show "N/A" when it's obvious that Garbage Collection occurred (i.e. less memory used than when pathfinding started)Edit: Removed memory usage display, see comment below.
Old Screenshot
Additional Changes
ExecutorService
to main plugin and teardown/rebuild the executor as neededPathfindingTests
doesn't need to run pathfinding on a separate threadAtomicBoolean
was unnecessary in this context and can be replaced withvolatile boolean
String.isBlank
inTransport.java