IPED
IPED copied to clipboard
Review Thread creation and re-usage through the application
Tests done on #1834 and preliminary results on #1850 suggest me thread concurrency can be very bad... For a long time I have seen in task manager a lot of CPU time spent as "kernel time", that may mean lots of context switches (not sure) or maybe just kernel function calls like IO calls (which shouldn't use much CPU...). I'm also kind surprised by how much IPED uses the CPU on machines with 48 logical cores with CPU bound tasks like OCR disabled, since processing evidences usually is IO bound...
We have short lived Threads creation in some places, and also Threads used just to consume external processes output/error streams. Those may cause more context switches than necessary.
A single (or a few) common Thread Pool to be reused by application modules may optimize processing because of less context switches, I think this is worth to test...