Jump to content



Photo

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

win7 winxp vista

  • Please log in to reply
75 replies to this topic

#1 UXGaurav

UXGaurav

    Tried Classic Shell? It has 15 million+ downloads & growing

  • Tech Issues Solved: 1
  • Joined: 18-October 05
  • Location: Windows
  • OS: Windows

Posted 02 November 2011 - 16:31

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:
http://www.youtube.com/watch?v=ay-gqx18UTM&fmt=18
http://www.youtube.com/watch?v=ToFgYylqP_U

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).


#2 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 17
  • Joined: 20-February 11
  • OS: Windows 8.1, BSD Unix
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 02 November 2011 - 16:51

Still couldn't pay me to go back to XP though, there's just so much that 7 does better than XP that a tradeoff for a bit of GUI performance just isn't worth it to me. (Never mind all the annoying quirks and glitches than XP still has.) And that's just old style GUI rendering, doesn't mean the application itself is any faster... more often than not 7 outperforms XP where it really matters, and randomly scrolling a file manager as crazily as possible isn't one of the top criteria.

#3 n_K

n_K

    Neowinian Senior

  • Tech Issues Solved: 3
  • Joined: 19-March 06
  • Location: here.
  • OS: FreeDOS
  • Phone: Nokia 3315

Posted 02 November 2011 - 17:00

Wasn't the direct GDI rendering in XP the source of a few security vulnerabilities?
I remember the fix before MS finally got a patch out was to unregister the built-in picture viewer, so quite frankly, to have slightly slower window drawing VS a much better security side with less hardware exploits, it's a worthwhile sacrifice.

#4 hornett

hornett

    Cult-leader

  • Joined: 11-September 03
  • Location: Blighty

Posted 02 November 2011 - 17:01

I personally have not noticed 7 being slower to redraw than XP other than very slightly during resizing windows (which is par for the course with a compositing window manager).

Anyhow, you might find that the 6 functions which are accelerated might actually make up 50% of the calls in real world usage.

#5 Eric

Eric

    Neowinian Senior

  • Tech Issues Solved: 12
  • Joined: 02-August 06
  • Location: Greenville, SC

Posted 02 November 2011 - 17:14

There's a bit of a difference, though. In Vista/7 GDI apps don't run in the same "space." (Having more of them open doesn't make it slower.)

#6 Udedenkz

Udedenkz

    /人◕ ‿‿ ◕人\

  • Joined: 28-October 07
  • Location: Internet

Posted 02 November 2011 - 17:37

This is obvious and well known.
XP GUI without divers is horribly slow, but with drivers -benchmark wise- it is much faster than Windows 7 GUI.


The black (sometimes white) underframe effect can be seen in virtually everything. When I maximize Opera, I see this effect.
Microsoft simply hasn't bothered hiding this for some bloody reason.
They could have sped up services and policy editors to render significantly faster to make that effect not so horrid - they didn't.

I am also not sure that D2D fixes the issue...

Edited by Udedenkz, 02 November 2011 - 17:39.


#7 OP UXGaurav

UXGaurav

    Tried Classic Shell? It has 15 million+ downloads & growing

  • Tech Issues Solved: 1
  • Joined: 18-October 05
  • Location: Windows
  • OS: Windows

Posted 02 November 2011 - 18:07

Anyhow, you might find that the 6 functions which are accelerated might actually make up 50% of the calls in real world usage.


True that and Microsoft's claim is exactly that users may not find that noticeable of a difference plus they already have acceleration for the most commonly used functions in Windows 7.

I am not saying go back to XP either. I am making those who dunno aware to send feedback to Microsoft to fully accelerate GDI once again as the entire ecosystem of Windows apps are never going to be rewritten to use Direct2D. :) If GDI is fully hardware accelerated, there would be no slowdown. Graphics manufacturers as Tom's hardware says pay no attention to 2D performance any more in their race to chase the highest FPS for 3D performance.

#8 Aethec

Aethec

    Neowinian Senior

  • Joined: 02-May 10

Posted 02 November 2011 - 20:42

GDI will be fully hardware-accelerated soon, since they're rewriting it as a layer above DirectX. All existing apps will use Direct2D, DirectWrite and DirectX APIs, via the GDI.

See this MS patent on redirecting graphic calls: http://www.freepaten...20090328080.pdf
and this slide:
Posted Image

from this presentation: http://download.micr...-t515_wh08.pptx


PS: Like it or not, GDI is old and completely obsolete, and never allowed what Direct2D allows in terms of performance. There's a reason why no browser implements content acceleration on XP (except Opera, which does so using OpenGL and not DirectX)

#9 OP UXGaurav

UXGaurav

    Tried Classic Shell? It has 15 million+ downloads & growing

  • Tech Issues Solved: 1
  • Joined: 18-October 05
  • Location: Windows
  • OS: Windows

Posted 03 November 2011 - 12:04

GDI will be fully hardware-accelerated soon, since they're rewriting it as a layer above DirectX. All existing apps will use Direct2D, DirectWrite and DirectX APIs, via the GDI.

from this presentation: http://download.micr...-t515_wh08.pptx

PS: Like it or not, GDI is old and completely obsolete, and never allowed what Direct2D allows in terms of performance. There's a reason why no browser implements content acceleration on XP (except Opera, which does so using OpenGL and not DirectX)


Lol what? That is from a Windows 7 WinHEC presentation which simply says Direct2D will replace GDI for new apps which it has already. Doesn't mean all GDI apps will transform themselves into Direct2D apps without developers rewriting them. GDI is deprecated as of Windows 7 (2009) because WPF was a managed code platform meaning all native code apps written from the beginning of Windows to 2009 and the dozens being written today still use GDI.

#10 ~Johnny

~Johnny

    Earthling

  • Joined: 10-August 08
  • Location: London, England, Earth, Milky Way

Posted 03 November 2011 - 12:13

The Windows Live Essentials suite does use Direct 2D in certain areas - Windows Live Messenger and Windows Live Mail do for sure, and I'm sure I've heard them mention all the other apps in the suite do too.

DWM also doesn't draw fully twice - it draws once too a bitmap off screen, and then when that's complete it just copies the bitmap for use / composition - it doesn't go through draw operations again. (In effect similar to a standard frame buffer then?)

#11 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 17
  • Joined: 20-February 11
  • OS: Windows 8.1, BSD Unix
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 03 November 2011 - 12:15

GDI is deprecated as of Windows 7 (2009) because WPF was a managed code platform meaning all native code apps written from the beginning of Windows to 2009 and the dozens being written today still use GDI.

Not all unmanaged programs use GDI, there are a few that use Direct2D. As a guess most of them are retaining pure GDI mode just for backwards compatibility with XP, until it officially dies off anyway.

#12 Tony.

Tony.

    Neowinian Senior

  • Joined: 10-February 05
  • Location: Liverpool, UK
  • OS: Windows 7

Posted 03 November 2011 - 12:20

Yes we knew this, we knew GDI+ had it's day and Direct2D is meant to be taking over. Unfortunately, we won't see the real benefits until developers kill off GDI all together. Microsoft didn't drop it to **** people over, it's just a legacy system that doesn't fit well with a new method they've come up with. We knew it'd take time, but there are apps out there and they run really nice with Direct2D.

#13 Joey S

Joey S

    Neowinian

  • Joined: 23-September 11

Posted 03 November 2011 - 12:22

I can confirm this. I've written some GDI apps for Windows, and primitive drawing operations are definitely slow under Windows 7 than XP.

Not all unmanaged programs use GDI, there are a few that use Direct2D. As a guess most of them are retaining pure GDI mode just for backwards compatibility with XP, until it officially dies off anyway.

There's another aspect you're not taking into account. Direct2D is horrible to use from C.

#14 OP UXGaurav

UXGaurav

    Tried Classic Shell? It has 15 million+ downloads & growing

  • Tech Issues Solved: 1
  • Joined: 18-October 05
  • Location: Windows
  • OS: Windows

Posted 03 November 2011 - 12:25

@~Johnny, is it Wave 4 of Live Essentials that you are saying uses Direct2D? Where has MS published this? Btw unfamiliarity with Direct2D also means that most developers still continue to write apps that use good old GDI on Windows 7. Just XP market share reducing won't make developers start writing D2D apps.

#15 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 17
  • Joined: 20-February 11
  • OS: Windows 8.1, BSD Unix
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 03 November 2011 - 12:26

There's another aspect you're not taking into account. Direct2D is horrible to use from C.

I dunno, I've had a pretty easy time with it in C++. Very well documented on MSDN. Plus you can mix and match GDI with Direct2D, also well documented on MSDN. Of course there's a learning curve, always is with the new and improved API's.