Package sc.fiji.snt.viewer
Class BvvProfiler
java.lang.Object
sc.fiji.snt.viewer.BvvProfiler
Lightweight, opt-in profiling aid for the BVV/BDV viewers (Stream mode).
Everything is controlled by JVM flags read once at class load. With no flag
set, the switches below are
static final constants: the JIT removes
the timers entirely, so there is no per-call cost.
-Dsnt.profile=true: named timers (aggregated count/total/max per label, with calls on the EDT counted separately) and a summary table printed every-Dsnt.profile.reportSec(default 10). This is the only output-Dsnt.profile.n5=true: also timesN5Readercalls (seewrap(N5Reader))-Dsnt.profile.slow=true: also prints each EDT call slower than-Dsnt.profile.slowMs(default 30)-Dsnt.profile.edt=true: also starts an EDT monitor that adds two rows to the summary: the latency of a no-op posted to the EDT every 50 ms, and the number and duration of stalls longer than-Dsnt.profile.stallMs(default 150)-Dsnt.profile.edt.dump=true: also dumps the EDT stack (and the lock it waits for) during each stall
[SNT-PROF]-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic voidreport()Prints the summary table now, sorted by total timestatic voidreset()static longstart()static voidStarts the periodic reporter and, if requested, the EDT monitor (idempotent)static voidRecords the time elapsed sincetokenunderlabelstatic org.janelia.saalfeldlab.n5.N5Readerwrap(org.janelia.saalfeldlab.n5.N5Reader reader) Wrapsreaderin a proxy timing every call (labelledn5.<method>) and tracking concurrency.
-
Method Details
-
isEnabled
public static boolean isEnabled() -
startIfEnabled
public static void startIfEnabled()Starts the periodic reporter and, if requested, the EDT monitor (idempotent) -
start
public static long start()- Returns:
- a start token for
stop(String, long); 0 if disabled
-
stop
Records the time elapsed sincetokenunderlabel -
report
public static void report()Prints the summary table now, sorted by total time -
reset
public static void reset() -
wrap
public static org.janelia.saalfeldlab.n5.N5Reader wrap(org.janelia.saalfeldlab.n5.N5Reader reader) Wrapsreaderin a proxy timing every call (labelledn5.<method>) and tracking concurrency. Returnsreaderitself if profiling is disabled or the proxy cannot be created. NB: code casting the result to a concrete reader class will fail
-