There is a fairly well-known article by the Sutter Emblem "
The Free Lunch Is Over. A Fundamental Turn Toward Concurrency in Software ". It says that there is no need to hope for an increase in the microprocessor clock frequency. To improve the performance of programs, it is now necessary to use several cores in a microprocessor. Although the article was written in 2005, so far it has been for me more a theoretical than a practical guide to action. Previously, I always got accelerated by purchasing a new computer. But then came the moment when this did not happen.
Figure 1 - Unit test time on my old and new machine.
When developing the
PVS-Studio project, we regularly use tests, the execution time of which on my machine with two cores was about 90 minutes. This is not very long, but in the afternoon does not fit. The work of PVS-Studio is to analyze the source code in C / C ++ and issue additional warnings to users of Visual Studio 2005/2008, where their program may be incorrect for 64-bit or parallel systems. In this case, the main resource consumed is the number and speed of cores, as well as the amount of RAM. Classic counting problem. In addition, I sometimes lacked 4 GB of memory for experiments with 64-bit errors that occur when processing large arrays. In short, I wanted a slightly more powerful working machine :-).
It was:
Intel® Core ™ 2 Duo Processor E7200, 2.40 Ghz, 4Gb, 64-bit. Windows Vista 64-bit operating system.
It became:
Intel® Core ™ 2 Quad Processor Q9400, 2.66 Ghz, 8Gb, 64-bit. Operating system Windows 7 64-bit.
')
The remaining parameters cite no sense. Video cards, though different, do not affect the speed of
static code analysis . Hard drives of different sizes, but of the same class.
And now we will start comparison of these systems. Immediately, I stress that the analysis is one-sided and cannot reflect the whole picture. The goal was not to accurately compare the performance of the two processors. I investigated the speed of solutions to the problem that interests me.
To begin, I compared the speed of the internal unit tests. Unit tests use only one core, but I expected to see a slight performance boost due to a slightly higher clock speed. The result was exactly the opposite!
Figure 2 - Measurement of the speed of the unit tests of the 64-bit version of the analyzer. The average running time for the 5 launches is given.
I do not know what caused such a performance failure. Therefore, I will not comment on this measurement.
This experiment may be quite inaccurate. Let's move on to this test. Compare the speed of the large tests:
Figure 3 - Running long-term tests, during which 32 software projects are tested. The testing process involves the Visual C ++ compiler, the PVS-Studio analyzer and the comparison system of the output results.
Figure 4 - The same, but in the form of a graph.
If you use only two cores on a new system, then the speed of work coincides with the speed of work on an old machine with two cores. There is no acceleration due to the higher core frequency. When using four cores, the result is much better. The goal is achieved - the tests fit in one hour. The fact that the acceleration does not occur twice is due to the fact that the test process is not completely parallel and contains sequential procedures.
I don’t want to build theories why such data were obtained from speed measurements and what could be a mistake. I want to say that the time has come when the freebie has ended. When purchasing a new computer with a large number of cores, you should not hope that old programs will work faster on it. The advantage can be obtained only from the use of programs that can use several cores.