• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

Did you know: All GDI apps render slower under Win7?

Question

Microsoft BOB™ 10    778

Okay this is well known since Vista and Windows 7 came out but just to make some of you aware who might now be knowing:

Some information :

http://msdn.microsof...0(v=vs.85).aspx

http://blogs.msdn.co...2d-and-gdi.aspx

http://blogs.msdn.co...in-windows.aspx

http://www.passmark....performance.htm

And some benchmarks:

Part 1: http://www.tomshardw...s-gdi,2539.html

Part 2: http://www.tomshardw...gdi,2547-1.html

And some demos:

What they're all basically saying:

Under Windows XP, GDI is fully hardware-accelerated by the GPU. Windows Vista removed GDI acceleration completely and therefore GDI runs on the CPU without any optimization. Under Windows 7, GDI runs on the CPU, but is partially accelerated, a very small subset of operations are optimized to be faster. Specifically, only 6 operations are accelerated out of hundreds of GDI operations.

So how does this correspond to graphics performance? GDI has been used from the very beginning of Windows until now. It's "the" main tool to draw interface elements and other such things in Windows. So to say... your web browser, your IM windows, your Explorer interface, the Control Panel, the widgets on your desktop, most of them use GDI to draw their interfaces. The only exceptions are applications that support Direct2D, which have recently come out: Firefox 4, and Internet Explorer 9. So GDI is used to draw pretty much... everything. What about those transparent/glass frames in Windows 7? Well, they're part of the new Desktop Window Manager (DWM) process, which acts as an overlay to the underlying windows.

DWM redirects window draw routines to an offscreen buffer and then re-draw them back to the main screen. That means for any window, DWM is redrawing their contents... twice. Coupled this with slower GDI performance than Windows XP. On the other hand, DWM will ensure the contents of the window fit in before it redraws the whole window, so when you drag the window around, it won't cause graphical glitches because now the window will only be redrawn when it's complete.

On the other hand, not using DWM will free up a lot of CPU resources. But still not enough to make GDI render operations as fast and responsive as Windows XP, as XP has more CPU free to do other tasks. If there is a fix for this, I would love to know, too... but it seems like this is already an integral part of Windows 7. The driver model has had to be rewritten to accomodate the new driver device interface (DDI) of DirectX 10 and beyond, and they had to shaft GDI hardware acceleration to accomplish that. They chose to remove GDI hardware acceleration as they found it hard to combine both driver model features. So there is no likely fix in the future except for a whole new edition of Windows.

That said, though, it's not all a loss. Developers can move to Direct2D, and bring hardware acceleration back to their Windows 7 applications. The problem is, though, that Direct2D is not so widely accepted. Not a lot of developers feel inclined to use it when most PCs nowadays can handle GDI in their CPUs just fine. Plus Direct2D is a whole new library, so learning it would be like discarding years of knowledge about window interface programming. Even Microsoft themselves are not doing too many things in Direct2D explicitly... except for Internet Explorer 9 no Microsoft app is using D2D AFAIK. Windows Live Messenger, Windows Media Player, Windows Explorer, and the various control panels within Windows 7 are still using GDI to draw their interfaces.

So I think whether or not we'll see smooth applications is entirely up to software developers. So to sum it up for the layman and for those who might not have enough time to read all of the rambling I wrote above:

Windows XP beats Windows 7 hands down when it comes to GDI rendering performance and 99.9 % of apps use GDI. But Windows 7 has less drawing glitches thanks to DWM. Windows Vista/7 do not have hardware accelerated GDI rendering or hardware accelerated audio rendering either (DirectSound).

If Microsoft is banging the IE9 drum about how great it is to have a hardware accelerated browser, it's because it was because IE7 and IE8 were giving slower performance on Windows Vista/7 compared to the same browsers on XP.

Moral of the story: Be informed before you trash XP as having slower graphics rendering. It's only Direct2D rendering which XP doesn't have (and which very few apps use today). GDI and 2D drawing have always been hardware accelerated up to XP even by non-3D hardware. Today, all your GDI apps run slower than XP. And send feedback to Microsoft to accelerate all GDI operations in a future Windows version (WDDM 1.3 or 1.4).

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0
england_fanboy    17

What?? GDI and the Win32 API's are official. The Direct*D API's are not a requirement to build Windows GUI's. You do know that right?

MSDN clearly says one should no longer use GDI for Windows programs:

Technologies that are obsolete and should not be used in new applications.

This is what MSDN says about GDI (legacy graphics).

http://msdn.microsoft.com/en-us/library/ee663279(v=VS.85).aspx

Share this post


Link to post
Share on other sites
  • 0
Joey S    30

Uh yea they are if you're wanting to build against Direct2D, what you were whining about being so difficult in the first place, hence "refusing to use the APIs"?

And why would I want to build against Direct2D when I'm coding in C?

Share this post


Link to post
Share on other sites
  • 0
Max Norris    2,130
And why would I want to build against Direct2D when I'm coding in C?

And round in circles we go. Oh I don't know, programming new projects for current technology appropriate to the platform versus legacy/depreciated stuff that's getting phased out maybe? If your tools of choice aren't up to the job, it might be time to consider switching to something more appropriate to the platform.

MSDN clearly says one should no longer use GDI for Windows programs:

This is what MSDN says about GDI (legacy graphics).

http://msdn.microsof...e663279(v=VS.85).aspx

Link's busted, fixed it for you. MSDN

Share this post


Link to post
Share on other sites
  • 0
Joey S    30

MSDN clearly says one should no longer use GDI for Windows programs:

This is what MSDN says about GDI (legacy graphics).

http://msdn.microsof...e663279(v=VS.85).aspx

Ignoring the fact that that page won't load, I, as a developer, wish to target both XP and Windows 7, so GDI is the best solution because it's supported on both platforms, unlike Direct2D. It's built right into the Win32 API, unlike the Direct*D interfaces, which are separate and use COM (horrible to use from most language bindings).

Share this post


Link to post
Share on other sites
  • 0
england_fanboy    17

Ignoring the fact that that page won't load, I, as a developer, wish to target both XP and Windows 7, so GDI is the best solution. It's built right into the Win32 API, unlike the Direct*D interfaces, which are separate and use COM (horrible to use from most language bindings).

There is absolutely no excuse for sticking to plain C Win32 API any more. The whole world is moving on. C++/C# is the way forward. Plain C is simply not good enough for today's complex programming needs.

Share this post


Link to post
Share on other sites
  • 0
Joey S    30

There is absolutely no excuse for sticking to plain C Win32 API any more.

That's what 99% of WIndows programs use lol.

The whole world is moving on. C++/C# is the way forward. Plain C is simply not good enough for today's complex programming needs.

No thanks. I prefer patent unencumbered programming languages like Python, Java, Perl to C#. As far as C++ goes, If I want to use a OO design pattern, again, i'll use Java or Python. I really don't see a use for C++ these days.

Share this post


Link to post
Share on other sites
  • 0
england_fanboy    17

That's what 99% of WIndows programs use lol.

LOL! Are you living in 1993? Almost no Windows programs are written in plain-C any more.

No thanks. I prefer patent unencumbered programming languages like Python, Java, Perl to C#. As far as C++ goes, If I want to use a OO design pattern, again, i'll use Java or Python. I really don't see a use for C++ these days.

C# is the most elegant programming language in the world. That's why its popularity is rising exponentially. If you prefer native code instead, C++ is great. But Java is the worst programming language in the history of mankind. It's a complete mess, a lot like Android.

Share this post


Link to post
Share on other sites
  • 0
Joey S    30

LOL! Are you living in 1993? Almost no Windows programs are written in plain-C any more.

The Win32 API, not C. Reading comprehension?

C# is the most elegant programming language in the world.

Cool story. Bro.

That's why its[C#] popularity is rising exponentially.

Really? From what I've read, It hasn't made an impact. This could be attributed to the fact that it's locked down to Windows of course. I prefer to write portable code.

If you prefer native code instead, C++ is great. But Java is the worst programming language in the history of mankind. It's a complete mess, a lot like Android.

Java is the language of choice for Android, Nuff said.

Share this post


Link to post
Share on other sites
  • 0
The_Decryptor    1,105

...

It's built right into the Win32 API, unlike the Direct*D interfaces, which are separate and use COM (horrible to use from most language bindings).

Uh, COM and Direct2D (And DirectWrite/Direct3D/etc.) are part of Win32.

Share this post


Link to post
Share on other sites
  • 0
Tilt090    13

so its decided win7 is slower eh.. and since people will continue to develop for gdi its a no brainer to move to the faster os ... snicker snicker...

Share this post


Link to post
Share on other sites
  • 0
Aethec    633
No thanks. I prefer patent unencumbered programming languages like Python, Java, Perl to C#. As far as C++ goes, If I want to use a OO design pattern, again, i'll use Java or Python. I really don't see a use for C++ these days.

Don't tell me you've never read Gosling's explanation about how they had to patent everything at Sun, and how they made contests of who got the most stupid patent?

Fact: If someone tells you his creation is not patent-encumbered, that doesn't mean it isn't. Look at Android and WebM.

Really? From what I've read, It hasn't made an impact. This could be attributed to the fact that it's locked down to Windows of course. I prefer to write portable code.

*cough* dotGNU *cough* Mono *cough*

Also, http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Share this post


Link to post
Share on other sites
  • 0
Joey S    30

*cough* dotGNU *cough* Mono *cough*

Also, http://www.tiobe.com...tpci/index.html

Both of which have fallen into disuse and have questionable compatibility with Microsoft's implementation, as evidenced by Canonical's recent decision to exclude Mono from future Ubuntu releases.

Share this post


Link to post
Share on other sites
  • 0
pcunite    2

Thanks for this post, I thought I was the only one noticing this.

I use a certain application maximized on my Windows 7 x64 workstation having upgraded from Windows XP. The application shows objects, about 200 of them on screen, and when I go to scroll, it is noticeably slower and somewhat flicky under Windows 7. Since the developer must support XP I doubt I'll see any improvement for a long time. Would be better for MS to fix this.

Share this post


Link to post
Share on other sites
  • 0
The_Decryptor    1,105

There's nothing for MS to fix, it's up to the developer to make their program work properly.

Share this post


Link to post
Share on other sites
  • 0
Brandon H    1,888

@Joey S and @Tilt090

not to sound rude (unlike Tilt sounds from my perspective)

but grow up and stop living in the past. Things change, in the world of technology you need to learn to adapt

Share this post


Link to post
Share on other sites
  • 0
ArialBlue    395

So if I get this straight, an application must use D2D/DW or suffer a major performance drop on post-XP era Windows?

Share this post


Link to post
Share on other sites
  • 0
Brandon H    1,888

So if I get this straight, an application must use D2D/DW or suffer a major performance drop on post-XP era Windows?

where are you getting the "major" from? as has been stated, it's a barely noticeable performance drop under most hardware

Share this post


Link to post
Share on other sites
  • 0
The_Decryptor    1,105

The most important GDI operations are hardware accelerated under Windows 7, so the majority of users wouldn't notice any slowdowns.

The main problem with using GDI rendering is that it's pretty crappy, the speed has nothing to do with it.

Share this post


Link to post
Share on other sites
  • 0
PGHammer    517

so its decided win7 is slower eh.. and since people will continue to develop for gdi its a no brainer to move to the faster os ... snicker snicker...

And consider how old GDI is.

GDI goes back to 9x/NT4 - and was optimized to GDI+ in ME/2K Professional.

GDI+ is a crapton faster than GDI - and that was merely in ME and Windows 2000 Professional. GDI+ had one major issue (which it still has) - backward-compatibility issues with GDI-only displays.

How many GDI-only applications are there today?

And isn't that reality still the case with those GDI-only applications that exist today? (Backward-compatibility with older versions of Windows.)

The only GDI-only application I even know of is *Opera* - which is designed with WayBack compatibility first and foremost. (Even Mozilla isn't GDI-only, and hasn't been on Windows for a while.)

Not one messaging client is GDI-only. (That includes Facebook Messenger, by the way.)

Share this post


Link to post
Share on other sites
  • 0
The_Decryptor    1,105

GDI+ is a software version of GDI that can do AA (One big difference), it's often quite slower than GDI.

Share this post


Link to post
Share on other sites
  • 0
ArialBlue    395

Any 8 vs 7 benchmarks on this topic?

Share this post


Link to post
Share on other sites
  • 0
PGHammer    517

GDI+ is a software version of GDI that can do AA (One big difference), it's often quite slower than GDI.

*Often quite slower* on what hardware?

On low-end- non-accelerated onboard graphics of the G41 (Intel) or earlier sort?

Share this post


Link to post
Share on other sites
  • 0
HawkMan    5,230

*Often quite slower* on what hardware?

On low-end- non-accelerated onboard graphics of the G41 (Intel) or earlier sort?

Adding software AA to stuff makes it slower on ANY kind of hardware. the difference is wether you hardware is fast enough for you not to notice or not.

Share this post


Link to post
Share on other sites
  • 0
The_Decryptor    1,105

*Often quite slower* on what hardware?

On low-end- non-accelerated onboard graphics of the G41 (Intel) or earlier sort?

The GPU doesn't come into it since GDI+ runs on the CPU, you could have a GTX 570 or a simple framebuffer device, GDI+ will still be slower in most cases (GDI+ might win when it comes to 32bit textures, but only because GDI doesn't support them "well" :laugh:)

Share this post


Link to post
Share on other sites
  • 0
PGHammer    517

Are there still components in Windows 8 that have issues?

In Windows 7, there is Microsoft Management Console for example.

Microsoft Management Console dates back to Windows 2000 and was designed to replace all those separate panels with a single snap-in-compatible holder and snap-ins.

While some parts of Windows itself use MMC (Device Manager, and its big brother, Computer Manager, are both available as MMC snap-ins; in fact, Computer Manager is only found as an MMC snap-in), and there are non-Microsoft MMC snap-ins (Diskeeper uses MMC snap-ins, for example, so do several WMI applications and utilities) all too few programmers, developers, and companies - including Microsoft itself, to their shame - have done so; instead, they have avoided MMC as if it carried bubonic plague - or anthrax.

Windows 8 still includes MMC; however, like in previous versions of Windows, it remains horribly underused and underutilized.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.