I have QuPath 0.2.2 running on Windows 10.
I have a project with an image that was added manually, “Auto-generate pyramids” was checked.
Project contains a pixel classifier (thresholder with very high resolution).
When I try to run
... QP.createSelectAllObject(true) QP.addPixelClassifierMeasurements(classifier, classifierName)
from the Script Editor - it takes very long time to process.
From very low CPU load I was suspecting initially that it doesn’t even work…
In Windows Task Manager there is no 100%-occupied core of 8 available, only one core has noticeable extra load.
While exploring the issue, I realized it is apparently working in the same way on my machine even when called via GUI. But in that case there is an illusion of work because classifier display layer is making full use of CPU while I’m activating measurement (this is rather annoying UX “feature” - having an explicit toggle for the classifier preview would’ve been nicer). Classifier preview finishes quicker though, and the measurement time actually the same as when called from script.
I also tried running the script via CLI, with the same result.
On a different machine, where this script is intended to be used, the results are following:
- run via GUI - makes full use of CPU cores and completes quickly;
- run via Script Editor - clearly uses a single core and takes about the same time as I have locally.
It’s about 14 times difference in time.
I tried to limit the number of processors in QuPath settings from 8 to 6 - no observable difference.
I tried to run
java -jar ... instead of console executable - no observable difference.
I tried to make some screenshots from VisualVM on my local machine. Not really clean, but I couldn’t see any details worth to re-capture. I’m not sure what exactly to look for, so let me know what else I can measure.
Other performance-related topic I’ve been looking through, but it didn’t help me (some things I tried above are came from there):
What may cause the difference between running from GUI thread and script thread on the target machine?
(I’ll have to install JVM before being able to use VisualVM there. I would like to have a better idea what to look for before that.)
What may cause low performance in either case on my local machine?
I’m aiming to move from script to extension for different reasons. That might also help me make it work the same as it currently does when called from GUI on the target machine. But since there is no difference on the local machine, it will still be difficult for me to debug, and also means that it is not really reliable and might work slow on different machines.
I’d love to be sure it doesn’t waste time doing nothing.
Thanks in advance for any good pointers to chase it down.