LEADTOOLS Support
Imaging
Imaging SDK Questions
Performance problems under dual and quad core cpu
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, February 26, 2008 1:47:28 AM(UTC)
Groups: Registered
Posts: 4
Some Leadtools functions seem to suffer a decrease in performance by factor 2 on a dual core cpu and by factor 4 on a quad core cpu.
We could recognize this slow down for
L_CopyBitmap(&DestHandle, &m_BitmapHandle, sizeof(DestHandle));
and
L_SizeBitmap(&DestHandle, NewWidth, NewHeight, SIZE_RESAMPLE);
Does anybody have similar problems?
We are not able to reproduce the same problems in the leadtools samples.
#2
Posted
:
Tuesday, February 26, 2008 3:43:45 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Since the problems can not be produced on using our demo samples I think they are most likely related to your code. Make sure that you check your code for any memory leaks and that you handling the allocation and freeing of memory correctly.
Also, I would like to send you updated version of our LEADTOOLS DLLs. Can you please tell me the DLLs build number(Version info) that you have?
#3
Posted
:
Tuesday, February 26, 2008 11:24:35 PM(UTC)
Groups: Registered
Posts: 4
The dll's all have a
file version of 14.0.0.35 and a
product version of 14.0.0.035
We are running the Leadtools dll's in a multithreaded C++ WIN32 application developed with MS Visual Studio 2003. The Leatools functions are called withing the user interface thread and are not influenced by other background threads.
#4
Posted
:
Wednesday, February 27, 2008 12:59:30 AM(UTC)
Groups: Registered
Posts: 4
I have created a simple mfc-sample application (leadperf.sln) that shows the problem.
In this sample you can open an image with the open file dialog. This image is loaded, copied and resized for 5 times with the following code:
BOOL CleadperfDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
int iLoops = 5;
int iSuccess = 0;
time_t tStart = time(NULL);
while (iLoops-- > 0)
{
BITMAPHANDLE BitmapHandle;
L_INT iRes = L_LoadBitmap((L_TCHAR *)lpszPathName, &BitmapHandle, sizeof(BitmapHandle), 0, ORDER_BGR, NULL, NULL);
if (iRes == SUCCESS)
{
BITMAPHANDLE DestHandle;
iRes = L_InitBitmap(&DestHandle, sizeof(DestHandle), BitmapHandle.Width, BitmapHandle.Height, BitmapHandle.BitsPerPixel);
if (iRes == SUCCESS)
{
iRes = L_CopyBitmap(&DestHandle, &BitmapHandle, sizeof(DestHandle));
if (iRes == SUCCESS)
{
iRes = L_SizeBitmap(&DestHandle, 500, 500, SIZE_RESAMPLE);
if (iRes == SUCCESS)
{
iSuccess++;
}
}
}
}
}
time_t tEnd = time(NULL);
char Msg[1000];
sprintf(Msg, "Test run %d times with success in %d seconds.", iSuccess, tEnd-tStart);
MessageBox(NULL, Msg, "", 0);
return FALSE;
}
If you use the sample images (test1.jpg or test2.jpg) in the folder "Images" you can see that it runs about 4 seconds on a single core cpu and takes 15 seconds on a (even faster) dual core cpu!!!
#5
Posted
:
Wednesday, February 27, 2008 1:33:07 AM(UTC)
Groups: Registered
Posts: 4
Further tests have shown, that it is NOT a dual core problem, but dependent on the operating system.
It is slow on a Windows Vista and on a Windows Server 2003 (SP2) system, but fast on a Windows XP (SP2) system.
Our customers told us, that is was also fast on a Windows Server 2003 prior to SP2. But we didn't proof this configuration.
#6
Posted
:
Wednesday, February 27, 2008 7:29:01 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Boris,
Before I test your small
project here I would like to send you the latest LEADTOOLS patches since you
are running a very old build. Can you please send your serial number to support@leadtools.com for verification?
LEADTOOLS Support
Imaging
Imaging SDK Questions
Performance problems under dual and quad core cpu
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.