I am developing a 32-bit Windows application using Delphi XE3
I have a section code that carries out detailed computation that needs speeding up and can be run in multiple threads
I have designed it so that there is no need to use Mutex's or Critical Sections to control access while the individual threads run.
I make no attempt to set affinity or suggest ideal processor to use
The analysis takes about 1 minute in a single thread
The analysis takes about 40 seconds using multiple threads using all 6 available cores - i was expecting closer to 15-20 seconds (accepting some performance loss as inevitable)
Looking at the CPU performance .. the application does not seem to be using the full 6 cores.
If I replace the analysis code with a simple loop counter to burn CPU time I see full core usage .. and close to 6x speed improvement
So I suspect there is something in the analysis code that is causing threads to wait for each other.
The analysis does make extensive use of lists and creates new objects to put in these lists.
Are there implicit mutex/critical section issues associated with object creation/memory usage that might explain the lack of performance ?
Are there any good tips that might help unlock this performance issue?
Many thanks in anticipation for your thoughts/help
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…