I’m running multiple XPS to PDF conversions in my application and I’ve attempted to speed it up by running in parallel, however, I’m not seeing any performance improvements. In fact, the multi-threaded version is often slower than single threaded.
I’ve tried using Parallel.For, ThreadPool threads and managing my own threads, and all have similar results.
I’ve set up tests in benchmarkdotnet that confirm this is the case outside of my application.
I’m testing on Windows 10 email@example.comGHz (16 logical processors)processors
Should I expect that XPS to PDF conversion should be able to run in parallel with performance benefits, or is there some shared resource contention that limits multi-threaded performance?
Note, when I run the benchmarkdotnet ThreadingDiagnoser, it indicates many lock contentions when running in multi-threaded mode.
Is there anything I can do to get the benefits of multiple threads? If the answer is no, what if I spawned each conversion in it’s own asynchronous process? Would that have benefits? Or is the lock contention at a system level?
Thank you for your help