Today is NSW State election. Many people are queuing up at voting point.
Month: March 2015
Feel the power of parallel computing (OpenMP)
These two weeks, I am working on our product UI side to improve the performance of animation rendering. Previously, there is only one single thread to decode the animation line by line, and it takes around 50ms for the whole frame.
Now, I change the way of rendering, and let all lines parallel decode to fully take advantage of modern multi-core CPU.
Visual Studio natively supports OpenMP, it gives me a easy way to access this powerful tool.
To set this compiler option in the Visual Studio development environment
- Open the project’s Property Pages dialog box. For details, see How to: Open Project Property Pages.
- Expand the Configuration Properties node.
- Expand the C/C++ node.
- Select the Language property page.
- Modify the OpenMP Support property.
After some simple code update, surprisingly, I found that my frame decoding performance boosts 950% (almost 10 times faster), from 8 FPS to 76 FPS!
Let’s do simple test with the following code:
#define TEST_LENGTH 0x3fffffff
double mptest()
{
LARGE_INTEGER large_interger;
double dff;
__int64 c1, c2;
QueryPerformanceFrequency(&large_interger);
dff = large_interger.QuadPart;
//
unsigned char *test = new unsigned char[TEST_LENGTH];
QueryPerformanceCounter(&large_interger);
c1 = large_interger.QuadPart;
#pragma omp parallel for
for (int i = 0; i<TEST_LENGTH; i++)
{
test[i] = rand();
}
QueryPerformanceCounter(&large_interger);
c2 = large_interger.QuadPart;
delete test;
return (c2 - c1) * 1000.0f / dff;
}
double test()
{
LARGE_INTEGER large_interger;
double dff;
__int64 c1, c2;
QueryPerformanceFrequency(&large_interger);
dff = large_interger.QuadPart;
//
unsigned char *test = new unsigned char[TEST_LENGTH];
QueryPerformanceCounter(&large_interger);
c1 = large_interger.QuadPart;
for (int i = 0; i<TEST_LENGTH; i++)
{
test[i] = rand();
}
QueryPerformanceCounter(&large_interger);
c2 = large_interger.QuadPart;
delete test;
return (c2 - c1) * 1000.0f / dff;
}
int _tmain(int argc, _TCHAR* argv[])
{
printf("Random generation cost with MP %lfmsn", mptest());
printf("Random generation cost without MP %lfmsn", test());
_getch();
return 0;
}
Look at the huge difference!
Ready for 2015 Australia badminton super series
http://australianbadmintonopen.com.au/news/100-line-judge-training-commences
Another year Australia badminton super series
Positions for line judging are still available. Interested parties, please contact Kate at australianopenlinejudge2015@gmail.com
Microsoft .NET Framework 4.x Redistributable Installer Link
Sometimes, it’s hard to find Microsoft .Net framework 4.x installer link.
Here is my collections for the link:
Download a hotfix without contacting Microsoft?
I am working on Windows 7 Embedded recently, and need some hotfix, which is not publicly released by Microsoft. I found this article very useful.
How can you download a hotfix without contacting Microsoft?
Here is the tricks:
A customer can get the fix they want without calling in to Microsoft, assuming they know the KB number of the hotfix they want and can remember the URL format for a self-service hotfix request:
http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=KBNumber&kbln=KBLanguage