Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Ribbon performance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon performance

 Post Reply Post Reply
Author
Message
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon performance
    Posted: 03 June 2006 at 6:12pm

This may sound stupid but I noticed that the performance of the Ribbon is way better if an Office 2007 application is also running.

This behavior is reproduceable, start the RibbonSample and move the mouse fast over the groups, the highlighting feels a little bit sluggish, non responsive.

Now start Excel or Access Beta1 TR or Beta2, minimize the Office app and move the mouse cursor over the ribbon groups, very fast and responsive.

Actually the whole application is faster, resize the RibbonSample without an Office app running and with, it is again way faster if an Office app is also running.

I know that this may sound stupid, but the performance increase is amazingly. To be honest if anybody else would tell me that story I would believe that he is stupid.

I guess that there are others who have the Office 2007 Beta installed, so please try it out.

 

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2006 at 6:45pm

I should rename the topic title because it's not only the Ribbon, I can also reproduce it with the Utilities.StylerBrowser.exe which doesn't have a Ribbon.

It affects the "Office 2007" and "Ribbon" theme.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2006 at 7:32am

Does anyone else have the same performance problems with the Q2 (10.2) Ribbon/Office 2007 theme?

It's way slower than Q1 (10.1) was, tested on different PCs.

But as soon as an Office 2007 app is running it's as fast as Q1 was.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 9:17am

Could someone from Codejock please have a look at this because currently the Ribbon / Office 2007 theme is too slow to be used.

I've tested the precompiled sample as well as the release build on several PCs (Win2000 and XP, dual and single CPU) and it's mega-bad.

Office 2007 Beta is installed on one PC and as soon as I start Excel/Access the Ribbon sample runs way faster, as fast as Q1 was.

 

Codejock support
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 1:31pm
Does it happen if you run the EXEs provided here: http://www.codejock.com/downloads/samples/ribbon.asp

Maybe you can try a few and see if the results are the same.
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 2:23pm

Originally posted by SuperMario SuperMario wrote:

Does it happen if you run the EXEs provided here: http://www.codejock.com/downloads/samples/ribbon.asp

Yes, I've first tested the precompiled samples, then the 10.20 Evaluation with my own app, then I've build the Ribbon Sample and my own app with the 10.20 Release.

The Q2 Ribbon / Office 2007 theme is currently a show stopper

It's not only slow on a single PC but on every one I've tested it.

But as soon as I start Excel 2007 Beta 1 TR it is like 10 times faster. This is reproduceable again and again, I've also rebooted the PC many times in the meantime.

Start Ribbon sample: Slow

Start Excel 2007 Beta 1 TR: Fast

Close Excel: Slow

Start Excel: Fast

 

I've no idea what Excel does

 

P.S.: It's the same with the Utilities.StylerBrowser.exe sample and Office 2007 or Ribbon theme.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 3:53pm

Ok, those performance problems don't occur on a US Win2K system.

They occur on German Win2k and WinXp systems with Office 2007 installed on the XP system.

I'll try to track the problem down tomorrow, any idea what could cause the problem? Are there any code parts that I can disable to find the bottle neck?

Edit: As long as there are no tabs everything is fine.

Edit: void CXTPOffice2007Image::DrawImage(CDC* pDC, const CRect& rcDest, const CRect& rcSrc, const CRect& rcSizingMargins) const causes the performance problems, the DrawImagePart calls.

Edit 2: CXTPOffice2007Image::DrawImagePart, XTPImageManager()->AlphaBlend

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2006 at 5:44pm

CXTPImageManager::AlphaBlend causes the performance problem.

AlphaBlend calls into msimg32.dll -> AlphaBlend which itself calls into gdi32.dll

Is it possible that Excel replaces the gdiAlphaBlend function with their own implementation?

------------

The AlphaBlend implementation doesn't seem to have changed since 10.10, was it also used in 10.10? Maybe the source and destination are incompatible now?

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 5:39am

If I set the color depth of my screen to 24-bit everything works fine, but as soon as I set it back to 32-bit it's slow as hell.

The problem is the AlphaBlend function where the source and destination seems to have a different color depth if I set my screen settings to 32-bit. If the DCs are incompatible AlphaBlend is known to be slow.

Could you please fix this ASAP?

Thanks

Codejock support
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 9:01am

All this very strange... Nothing changed from 10.1 , now just ribbon have more images.

Yes, may be office activate some acceleration for AlphaBlend... but have no idea what can be done...

Anyway we plan to improve drawing by adding double buffer and not redraw whole ribbon when something was changed.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 9:12am

Originally posted by oleg oleg wrote:

All this very strange... Nothing changed from 10.1 , now just ribbon have more images.

How many and how large alpha bitmaps did v10.1 use and how many v10.2 now? The tabs are a large alpha bitmap now and I think it wasn't one in v10.1.

I guess you are using AlphaBlend to use a common set of bitmaps for different themes (Luna / Obsidian), couldn't you instead use non-alpha bitmaps?

Have you been able to reproduce the performance problems with a 32-bit color depth?

Originally posted by oleg oleg wrote:

Anyway we plan to improve drawing by adding double buffer and not redraw whole ribbon when something was changed.

That won't help when resizing the window because the Ribbon than needs to be redrawn.

 

P.S.: I did a quick hack,

BOOL CXTPImageManager::AlphaBlend(HDC hdcDest, const CRect& rcDest, HDC hdcSrc, const CRect& rcSrc) const
{
 return TransparentBlt (hdcDest, rcDest, hdcSrc, rcSrc, 0);
}

which solves all the performance problems. The result doesn't look pretty but I guess for many bitmaps transparency could be used instead of alpha blending.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 9:43am

I've just tested it on another workstation and even with a 32-bit color depth everything works just fine.

The only difference that I could find was that gdiplus isn't installed on that workstation.

But the msimg32 and gdi32 dll's are the same, so I'm not sure if it's that whats causing the problems.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 10:06am

Oleg, this is a little bit strange, I've tested it on 6 workstations, on 3 it's slow and 3 are ok.

The only thing that they have in common is that 3 have LCD monitors and 3 regular monitors.

On the workstations with a LCD monitor it's slow, but only if the color depth is not 24-bit.

Let me know if I you want to test anything else or need additional information.

Codejock support
Back to Top
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 10:13am

Did you think about your graphic board's drivers?

May be my question could sound stupid for a 2D rendering, but on some integrated cards or on low-cost cards, the drivers could be very slow to compute alpha rendering

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 10:29am

Originally posted by gwoin gwoin wrote:

Did you think about your graphic board's drivers?

I doubt that there is any hardware acceleration for alpha blending, GDI is solely software rendering.

The workstations also all have different graphic cards, from Matrox Millenium 550 / G450 to NVIDIA GeForce and a FX6600.

The problem occurs on several workstations, so I can't believe that I am the only one who has problems with the performance.

Codejock support
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 10:59am

Still, I do believe the driver question is a valid one. I would check that you have the latest driver on each workstation.

Also, you did not mention checking the video hardware acceleration setting. From the Display Properties > Settings > Advanced > Troubleshoot, make sure that the hardware acceleration is set to Full and enable write combining.

I hope this helps.

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 11:12am

Originally posted by gshawn gshawn wrote:

Still, I do believe the driver question is a valid one. I would check that you have the latest driver on each workstation.

Every workstation has a different graphic card, but they all have the latest drivers. Also AlphaBlending was introduced many years ago, so I doubt that a nVidia Quattro is the bottle neck here

Originally posted by gshawn gshawn wrote:

Also, you did not mention checking the video hardware acceleration setting. From the Display Properties > Settings > Advanced > Troubleshoot, make sure that the hardware acceleration is set to Full and enable write combining.

I've tried that too, I've set the hardware acceleration to 0% on a workstation where everything is fine and there was no difference.

Have you tested it on a LCD?

Codejock support
Back to Top
Sven View Drop Down
Senior Member
Senior Member


Joined: 21 August 2003
Location: Germany
Status: Offline
Points: 127
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sven Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 1:11pm
Maybe a ClearType issue?
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 1:17pm

Originally posted by Sven Sven wrote:

Maybe a ClearType issue?

Windows 2000 doesn't support ClearType and it's definitely the AlphaBlend call that causes the problems. So no need to speculate any longer

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2006 at 4:16am

Ok, we've tested it on 2 more workstations and 1 laptop and the result is the same.

It's awful slow on LCDs and the laptop.

And as I already reported 2 days before it is the AlphaBlend call that causes the performance problems if the color depth of the screen is not 24-bit, because then the source and destination DCs are incompatible!

The Q1 Ribbon/Theme wasn't useable because of bugs and limitations and Q2 isn't useable for about 50% of the users. After 2 months it would be nice to get a version that can be used for real world software.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2006 at 4:52am
Could you please confirm this problem and let us know when a fix is available.
Codejock support
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2006 at 5:36am
I can take some time and test it on an LCD... give me a few minutes.
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2006 at 5:55am

Just tried it here and it runs great, sorry...

Acer AL1916A 19" LCD
Windows Server 2003 SP1
Athlon XP 2500+
ATI 9800 Pro via DVI

The compiled Ribbon sample runs great in either 16-bit or 32-bit; I was unable to notice any slowdowns. I'm at a loss as to what to try next... Are there any specific tests or files versions you would like me to check?

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2006 at 6:11am

Originally posted by gshawn gshawn wrote:

Windows Server 2003 SP1

We've only tested it on 2000 and XP, on 9 different workstations and laptops, there was a huge performance penality on 5 of them and it runs great on 4. The only thing that they have in common is that those 5 have LCDs and the other 4 CRTs.

It was also independently tested by a customer, "I tried it here at home on my laptop and it's lagging something awful! This PC is about the same as the one I have at work, 2.8Mhz, 512mb, but it has a LCD that I'm running at 1400x1050 32bit. I notice when I move around the ribbon where the highlight should follow me, the CPU usage goes to 100%."

We've a bit of a problem here

 

Codejock support
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2006 at 10:15am

ok, we will try to optimize ggraphic to remove alpha layer from some bitmaps. Largest is Office2007_RibbonGroups.bmp so will start from it.

Can you uplease

1. download these bitmaps:

2006-06-10_101439_pack.zip

replace them in Source/Ribbon/res folder,

2. open sampe, replace

void CMainFrame::RecalcLayout(BOOL bNotify /* = TRUE */)
{
 CXTPFrameWnd::RecalcLayout(bNotify);
 Invalidate(FALSE);
}

to

void CMainFrame::RecalcLayout(BOOL bNotify /* = TRUE */)
{
 CXTPFrameWnd::RecalcLayout(bNotify);
// Invalidate(FALSE);
}

it decrease perfomance a lot.

 

3. rebuild sample and check perfomance.

 

Thanks

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2006 at 10:38am

Sample (compiled by myself) Seems to work here, too. (I don't have Office 2007 installed)

Pentium 3.2GHz, 1GB RAM, WinXP SP2 (en), GeForce 6600GT (PCI-X), Samsung SyncMaster 204Ts (LCD via DVI)

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2006 at 5:40am

oleg, the non-alpha Office2007_RibbonGroups.bmp has increased the performance alot, although it is still noticeable slower. Thanks.

I understand that alpha bitmaps make it easier to support different color schemes without changing the bitmaps and that there would be a size increase if you would make a set of bitmaps for each color scheme, but have you considered to use PNGs for the graphics? libpng and zlib can be used for free, even in commercial products.

That would reduce the graphics size from about 1.4 MB to 200 KB without any losses. You can also use GDI+ to load PNG resources.

http://www.codeproject.com/bitmap/PNGView.asp

http://www.codeproject.com/vcpp/gdiplus/cgdiplusbitmap.asp

 

Codejock support
Back to Top
Marcus View Drop Down
Groupie
Groupie


Joined: 04 June 2006
Location: Germany
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marcus Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2006 at 6:05am

Oh, please don't start using additional libraries like zlib in the toolkit!

A lot of developers, like me, prefer clean, simple, self-contained solutions! Adding unnecessary dependencies will only bloat and complicate everything!

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2006 at 7:01am

@Marcus: GDI+ can also be used to load PNG resources, you would only have to ship the gdiplus.dll with your application. libpng/zlib is just an other option.

Office 2007 and Vista also uses PNG for its icons. Currently LCDs have a resolution of 96 DPI but soon we will have 240/320 DPI screens and then uncompressed bitmaps are unuseable, or would you like to have 15 MB of Ribbon bitmaps?

Originally posted by Marcus Marcus wrote:

A lot of developers, like me, prefer clean, simple, self-contained solutions! Adding unnecessary dependencies will only bloat and complicate everything!

What would be the problem if libpng/zlib are added to the workspace? There would just be 2 additionally projects and you could compile the toolkit as always and get a lib or dll. That doesn't complicate anything.

Codejock support
Back to Top
Marcus View Drop Down
Groupie
Groupie


Joined: 04 June 2006
Location: Germany
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marcus Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2006 at 8:04am
Every library you're adding leads to more compatibility issues. GDI+ doesn't work on Win95, can you compiler zlib as a 64 bit dll?! It always gets messier as you first think.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.