LEADTOOLS Support
Imaging
Imaging SDK Questions
Performance of Leadtools 14.5 on a WinForms app
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, December 12, 2006 1:04:52 AM(UTC)
Groups: Registered
Posts: 1
I am creating individual thumbnails from a multi-page tif (102 pages) by calling RasterCodecs.ReadThumbnail(fileName, options, pageNumber). This call takes 4seconds in total for all 102 pages. Grayscaling the 102 thumbnails takes another 4 seconds. My options are setup in the following way:
options.LoadStamp = false;
options.BitsPerPixel = 8
options.Resample = true;
options.Order = RasterByteOrder.Gray;
options.PaletteFlags = ColorResolutionCommandPaletteFlags.None;
options.DitheringMethod = RasterDitheringMethod.Clustered;
It takes 13seconds in total to size the thumbnails.
SizeCommand command2 = new SizeCommand();
command2.Flags = RasterSizeFlags.Resample;
command2.Width = desiredWidth;
command2.Height = desiredHeight;
command2.Run(m_Image);
With all the other code it takes a total of 27seconds to create the 102 thumbnails and display them.
Is there something I can try to speed up this process?
Regards
Ed
#2
Posted
:
Tuesday, December 12, 2006 10:42:35 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
Depending on your hardware, this seems pretty normal for what you are trying to do. As far as LEADTOOLS is concerned, the only thing you can do to speed it up would be changing your SizeCommand.Flags property to RasterSizeFlags.Normal. This will be faster but will create a lower quality image.
From a basic programming perspective, you might be able to refactor your code some and reduce some of the processing done inside your loop. For example, don't declare anything (such as the line SizeCommand command2 = new SizeCommand();) inside the loop. Instead you should declare your variables outside of the loop to save on processing time. This might not save up that much time, but if 102 thumbnails is only a test case and you might be loading thousands, the frivolous processor instructions will add up. Take a look at your code and see what other general refactoring you can do to reduce the number of instructions you are carelessly executing.
Also, once you deploy your application and build under Release mode, it should speed up a little.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Performance of Leadtools 14.5 on a WinForms app
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.