This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
shockstump  
#1 Posted : Sunday, September 6, 2009 9:02:18 PM(UTC)
shockstump

Rank: Newbie

Groups: Guest
Joined: 5/21/2009(UTC)
Posts: 2

Hi,

I'm having some performance issues using Aurigma.GraphicsMill.Bitmap. The following code runs 10 times slower on
Windows 2008 server compared to Windows 2003 server. Both servers are virtual machines, with the following specs:

The specs for the servers are:
Win 2008 32bit
CPU: 8 x Intel Xeon E5335 @2.00Ghz
RAM: 8 GB


Win 2003 32bit
CPU: single Intel Core 2 660 @2.40 Ghz
RAM: 766 MB

I am using version 5.1.276.0 of Graphics Mill

Here's the code for a simple console app that demonstrates the problem:

Code:

class Program
    {
        static void Main(string[] args)
        {
            int counter = 1;
            if (args.Length > 0)
            {
                int.TryParse(args[0], out counter);
            }

            Console.WriteLine("Creating and disposing of {0} Aurigma.GraphicsMill.Bitmap objects sequentially...",counter );
            
            //grab the test image from embedded resource
            System.Drawing.Bitmap testImage = Resource1.testimage; //~3.5M JPEG 

             counter = Math.Abs(counter);
            DateTime start = DateTime.Now;
            for (int i = 1; i <= counter; i++)
            {
                using (Aurigma.GraphicsMill.Bitmap hiResBmp = new Aurigma.GraphicsMill.Bitmap(testImage))
                {

                }

            }

            double ms = DateTime.Now.Subtract(start).TotalMilliseconds;
            Console.WriteLine("{0} Bitmaps took {1} ms", counter, ms);

        }
    }


To give you some example numbers, creating 10 Bitmaps takes 1 second on my Win2003 box, but takes 12 seconds on Win2008! I have tested on other Win2008 and Win2003 servers, with similar results.

I have profiled this code using Jetbrain's dotTrace profiler & looked at the Graphics Mill code using reflector. The call stack to the hot spot is this:
Code:

Aurigma.GraphicsMill.Bitmap..ctor(Bitmap)
    Aurigma.GraphicsMill.Bitmap._Create(Bitmap)
       Aurigma.GraphicsMill.Bitmap._Create(Int32, Int32, PixelFormat, ColorPalette, Color)
         ?Create@BitmapData@ImagingFramework@@$$FQAEXKKW4PixelFormat@2@PBVColorMap@2@@Z*


I have 2 questions:

(1) can anyone reproduce this? (if not, what the hell am i doing wrong! Think )
(2) if it's reproducable, is it something that can be fixed in a future release?

cheers,

Sherwin

p.s have attached the console app that demonstrates the problem. Execute it like this:

C:\>bitmaptest 10
Creating and disposing of 10 Aurigma.GraphicsMill.Bitmap objects sequentially...

10 Bitmaps took 1462.1024 ms

Edited by user Sunday, September 6, 2009 9:05:39 PM(UTC)  | Reason: Not specified

File Attachment(s):
BitmapTest.rar (3,555kb) downloaded 2 time(s).
Win2003.dtc (374kb) downloaded 2 time(s).
Win2008.dtc (562kb) downloaded 3 time(s).
testimage.jpg (3,477kb) downloaded 2 time(s).
Alex Kon  
#2 Posted : Monday, September 7, 2009 1:52:19 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Guest
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hi Sherwin,

By now I cannot reproduce the issue.

Please, could you provide us some additional info:
  • Is it possible to run tests on same hardware? Maybe its not OS fault.
  • Could you rewrite test a little - to avoid System.Drawing.Bitmap usage - just with Aurigma.GraphicsMill.Bitmap class. To check, whether the issue is in interaction with System.Drawing.
  • Attach sample JPEG file.
shockstump  
#3 Posted : Monday, September 7, 2009 6:22:06 PM(UTC)
shockstump

Rank: Newbie

Groups: Guest
Joined: 5/21/2009(UTC)
Posts: 2

Hi Alex,

I have attached the JPEG i am using for testing to my original post. I've also attached the trace files created by Jetbrains dotTrace, you can get a free evaluation copy from http://www.jetbrains.com/profiler/download/index.html if you dont already have it. As you can see, there is a massive difference in time spent within the call to:?Create@BitmapData@ImagingFramework@@$$FQAEXKKW4PixelFormat@2@PBVColorMap@2@@Z*

Unfortunately i have not been able to test this on a *real* server: all my tests have been done on virtual machines provided by my hosting company. Have you tried running my attached test app on a *virtual* Windows 2008 machine?

I'll have a go at removing the System.Drawing.Bitmap dependency as you suggested.

Cheers,


Sherwin



Alex Kon  
#4 Posted : Friday, September 11, 2009 1:34:23 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Guest
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hi Sherwin,

Unfortunately we still have no success with reproducing the issue. I'll try some other environments with VMs in a next few days.

Have you tested your test app without intermediate System.Drawing.Bitmap class?

Best regards,
Alex Kon
Alex Kon  
#5 Posted : Sunday, September 27, 2009 8:20:51 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Guest
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hi Sherwin,

Sorry for the delay. Here are my results, each for 10 iterations run:
  • Vista x64 (Core2 Duo 1.86Ghz): ~700 ms
  • Windows Server 2008 on Virtual PC (Core2 Duo 1.86GHz): ~2500 ms
  • Windows Server 2008 on Virtual Server (Dual Xeon 3GHz): ~2200 ms
The results look like right ones, at least I don't see 10 times slowdown.

As for profiling snapshots - they look strange. As I can see they were got from rather different code, so its hard to compare them. I can see that Bitmap ctor on Win2003 works much faster, but I'm not sure that it has same input params as in Win2008 code. Also there is maybe some cache/optimization specific.

Beside that, it seems that Win2008 virtual machine works 5 times slower than Win2003 box (at least, in snapshots data) - take a look at main module ..ctor and SingleDomainUnload() timings.

Please, could you provide profiling snapshots for the same code & input? And, it will be great, if this code works with Graphics Mill only, without System.Drawing objects in the middle.

I will be looking forward for you answer, sorry again for a such delay.

Best regards,
Alex Kon.
Users browsing this topic
Guest (5)
Forum Jump  
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.