Recently, scientists from NCSU have discovered a technique that improves performance of applications up to 20% on a multicore system. And the technique does not need any change in existing code.
To understand its significance, we should first answer the question “why it is difficult to parallelize a desktop application?”.
If we take a word processing application as an example, it will have a loop waiting for a key to be pressed, and when it is pressed, it applies the format/styles to the character, displays the character on screen and returns to the wait loop. It is difficult to convert this logic into pieces of code that can execute in parallel, as the whole code is in a sequential flow and each step will wait for the previous step to complete. Such single threaded applications have little scope of parallelization and have not been able to get benefits of multiple cores.
That is why the news from the scientists at the North Carolina State university (NCSU) is exciting. They have found a simple, effective technique that allows existing programs to get benefits of speed improvement on a multicore system, that too without any change in the code.
What is their magic?
Most of the applications need dynamic memory and they allocate and free chunks of memory as per their needs. Programs don't care for the return value of the memory free() function. The NCSU scientists simply moved the free() function to another core from the main core. This allows free() code to run in parallel to main code. Since applications use malloc() and free() extensively in code, just moving free() code to another core gives improvements of 20% in performance!
This “simple drop in replacement” is achieved by linking applications with a new memory management library and it needs no change in the application code. It is a low hanging fruit of performance improvement and it is surprising how it has missed notice so long!
Simple techniques like this will help desktop user to get visible, tangible improvements in performance for their existing applications on multicore systems!
用户1582657 2013-1-4 14:04
Thanks ~