Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 130647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:58:52+00:00 2026-05-11T05:58:52+00:00

All you Stackoverflowers, I was wondering why GUI code is responsible for sucking away

  • 0

All you Stackoverflowers,

I was wondering why GUI code is responsible for sucking away many, many cpu cycles. In principle, the graphical rendering is far less complex than Doom (although most corporate GUIs will introduce lots of window dressing). The event handling layer is also seemingly a heavy cost, however, it seems that a well-written implementation should switch between contexts efficiently on modern processors with a lot of memory/cache.

If anybody has run a profiler on their big GUI application, or a common API itself, I’m interested in where the bottlenecks lie.

Possible explanations (that I imagine) may be:

  1. High levels of abstraction between hardware and application interface
  2. Lots of levels of indirection to the correct code to execute
  3. Low priority (compared to other processes)
  4. Misbehaving applications flooding API with calls
  5. Excessive object orientation?
  6. Complete poor design choices in API (not just issues, but design philosophy)

Some GUI frameworks are much better than others, so I’d like to hear varied perspectives. For example, the Unix/X11 system is much different than Windows and even than WinForms.

Edit: Now a community wiki – go for it. I have one more thing to add — I’m an algorithms guy in school and would be interested if there are inefficient algorithms in GUI code and which they are. Then again, it’s probably just the implementation overhead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:58:52+00:00Added an answer on May 11, 2026 at 5:58 am

    I’ve no idea generally, but I’d like to add another item to your list – font rendering and calculations. Finding vector glyphs in a font and converting them to bitmap representations with anti-aliasing is no small task. And often it needs to be done twice – first to calculate the width/height of the text for positioning, and then actually drawing the text at the right coordinates.

    Also, most drawing code today relies on clipping mechanisms to update just a part of the GUI. So, if just one part needs to be redrawn, the code actually redraws the whole window behind the scenes, and then takes just the needed part to actually update.

    Added:

    In the comments I found this:

    I’m also very interested in this. It can’t be that the gui is rendered using only the cpu because if you don’t have proper drivers for your gfx-card, desktop graphics render incredibly slow. If you have gfx-drivers however desktop-gfx go kinda fast but never as fast as a directx/opengl app.

    Here’s the deal as I understand it: every graphic card out there today supports a generic interface for drawing. I’m not sure if it’s called ‘VESA’, ‘SVGA’, or if those are just old names from the past. Anyway, this interface involves doing everything through interrupts. For every pixel there is an interrupt call. Or something like that. The proper VGA driver however is able to take advantage of DMA and other enhancements that make the whole process WAY less CPU-intensive.

    Added 2: Ah, and for OpenGL/DirectX – that’s another feature of today’s graphics cards. They are optimized for 3D operations in exclusive mode. That’s why the speed. The normal GUI just utilizes basic 2D drawing procedures. So it gets to send the contents of the whole screen every time it wants an update. 3D applications however send a bunch of textures and triangle definitions to the VRAM (video-RAM) and then just reuse them for drawing. They just say something like ‘take the triangle set #38 with the texture set #25 and draw them’. All these things are cached in the VRAM so this is again way faster.

    I’m not sure, but I would suspect that the modern 3D-accelerated GUIs (Vista Aero, compiz on Linux, etc.) also might take advantage of this. They could send common bitmaps to the VGA up front and then just reuse them directly from the VRAM. Any application-drawn surfaces however would still need to be sent directly every time for updates.

    Added 3: More ideas. 🙂 The modern GUI’s for Windows, Linux, etc. are widget-oriented (that’s control-oriented for Windows speakers). The problem with this is that each widget has its own drawing code and associated drawing surface (more or less). When the window needs to get redrawn, it calls the drawing code for all its child-widgets, who in turn call the drawing code for their child-widgets, etc.. Every widget redraws its whole surface, even though some of it is obscured by other widgets. With above mentioned clipping techniques some of this drawn information is immediately discarded to reduce flickering and other artifacts. But still it’s lots of manual drawing code that includes bitmap blitting, stretching, skewing, drawing lines, text, flood-filling, etc.. And all this gets translated to a series of putpixel calls that get filtered through clipping filters/masks and other stuff. Ah, yes, and alpha blending has also become popular today for nice effects which means even more work. So… yes, you could say this is because of lots of abstraction and indirection. But… could you really do it any better? I don’t think so. Only 3D techniques might help, because they take advantage of GPU for alpha-calculations and clipping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Without seeing some sample of the code, it is hard… May 12, 2026 at 12:11 am
  • Editorial Team
    Editorial Team added an answer http://www.codeproject.com/KB/WPF/wpfvalidation.aspx <TextBox Text="{Binding Path=Name}" /> And a function. This one… May 12, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer Yes, it makes quite a bit of sense to use… May 12, 2026 at 12:10 am

Related Questions

Lately I have been playing a game on my iPhone called Scramble. Some of
I'm about to start a new Windows app. It will be an audio processing
If all you see is the ugly no-char boxes, what tools or strategies do
Hello all you helpful folks @ stackoverflow! Best resources for Java GUI's? Looking at

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.