Why are .Net UIs slower than C++ or classic VB?

  • Thread starter Thread starter Jim Hubbard
  • Start date Start date
J

Jim Hubbard

I've noticed (for quite some time now) that .Net UIs are not as responsive
(see Franklin Covey's PlanPlus for Windows XP or Symantec's .Net Norton
Antivirus or even the .Net version of Paint done by Washington University vs
good old Paint UIs for examples).

They are also not as professional looking as the older applications and the
reaction times of the UIs is not professional looking at all.

Why do you think this is? Is it bad programming or is there something else
going on here?
 
Jim Hubbard said:
I've noticed (for quite some time now) that .Net UIs are not as responsive
(see Franklin Covey's PlanPlus for Windows XP or Symantec's .Net Norton
Antivirus or even the .Net version of Paint done by Washington University vs
good old Paint UIs for examples).

They are also not as professional looking as the older applications and the
reaction times of the UIs is not professional looking at all.

Why do you think this is? Is it bad programming or is there something else
going on here?

I agree. I think (and hope) it's a lot to do with GDI+ not being
accelerated (and it probably will never be, as WPF approaches).
Something I've especially noticed is that resize logic for forms with
lots of nested containers is especially expensive. Very laggy resizing
of 16 or so nested containers of different kinds shouldn't slow a 3GHz
machine to a crawl, but it can and does!

-- Barry
 
Well, I see two points of interest in this posting.

Firstly, some aspects of .NET display handling are slower, but I am more
then happy to occasionally sacrifice performance for the visual inheritance
that the .NET model gives me. No more days scouring sites for third-party
controls that have exactly the bizarre combinations of features, followed
by weeks of begging them to add the other features we require. Ah, blessed
relief.

The second point is that you seem to be trolling the newsgroups posting
inflammatory comments, for what reason I'm not sure, but I guess that you
feel any publicity is good publicity :)

I would suggest that anyone wanting to follow your line of argument use
Google to investigate the terabytes of newsgroup comments from VB6
developers between about 2002 and 2004, and leave this group free for
genuine questions and discussions.

Cheers,
Jason
 
JasonS said:
Well, I see two points of interest in this posting.

Firstly, some aspects of .NET display handling are slower, but I am more
then happy to occasionally sacrifice performance for the visual
inheritance
that the .NET model gives me. No more days scouring sites for third-party
controls that have exactly the bizarre combinations of features, followed
by weeks of begging them to add the other features we require. Ah, blessed
relief.

That's a good point. And, the object oriented nature certainly does allow
for easily extending the simple UI controls available for .Net. But, I am
asking about the UI slowness that I have seen in professionally designed and
distributed .Net applications. I want to avoid that slowness if possible.
The second point is that you seem to be trolling the newsgroups posting
inflammatory comments, for what reason I'm not sure, but I guess that you
feel any publicity is good publicity :)

Hmmmm...... So, asking non-flattering questions is trolling? AFAIK, these
applications could have been written poorly. Hence the question.

If there are specific programming techniques that make the .Net apps seem
slow and kludgy, I want to know so that I can avoid those things. So do you
know if it is due to programming technique or is it inherent in the .Net
framework?

There is actually an argument that can be made that states that .Net UIs
were made slower and more simplistic on purpose. It can most certianly be
viewed as inflamatory by people not of an open mind to thoughts contrary to
thier own. And, caring so deeply about your delicate nature, I would be
hesitant to post it here.
I would suggest that anyone wanting to follow your line of argument use
Google to investigate the terabytes of newsgroup comments from VB6
developers between about 2002 and 2004, and leave this group free for
genuine questions and discussions.

Questions about slow .Net UIs are not "genuine questions and discussions"?
Really?

Interesting...although I'm sure some of the more open-minded programmers
here would disagree.

Generally, I have found the members of this discussion group to be extremely
open-minded, willing to discuss .Net shortcomings (as well as its
accomplishments) and willing to help others avoid common programming errors
that may result in diminished performance in your .Net applications.

Jim
 
One of the reason might be GDI+ performance is too poor. Drawing a SXGA
bitmap using GDI+ takes 25ms on my computer.
 
Barry Kelly said:
I agree. I think (and hope) it's a lot to do with GDI+ not being
accelerated (and it probably will never be, as WPF approaches).
Something I've especially noticed is that resize logic for forms with
lots of nested containers is especially expensive. Very laggy resizing
of 16 or so nested containers of different kinds shouldn't slow a 3GHz
machine to a crawl, but it can and does!

-- Barry

The new Windows Presentation Foundation stuff looks much better than the UI
stuff we currently have for .Net.

Take a look at the demos for Windows Expression at
http://www.microsoft.com/products/expression/en/default.mspx. In the demos,
the UIs look fast and smooth. Not at all jerky or slow!

It's at the core of Vista's new look and is promised as an upgrade for XP
and 2003 Servers.

Just wish we had it now.....I'd hate to think I have to redo these apps all
over again a year (or so) from now.

Jim
 
The new Windows Presentation Foundation stuff looks much better than the
UI stuff we currently have for .Net.

It's at the core of Vista's new look and is promised as an upgrade for XP
and 2003 Servers.

You are right Jim!
Just wish we had it now.....I'd hate to think I have to redo these apps
all over again a year (or so) from now.

Thats why we tier apps right?

Cheers,

Greg
 
I very rarely get poor responsiveness on .NET software. I wonder if
perhaps you're imagining things? If, however, there *is* poor
performance on a .NET application, I would blame one of two people:
either a) you are running .NET on a 486 sx 30 with 4 MB ram, or b) the
programmer(s) didn't understand how to write Windows.Forms. In the case
of Norton Antivirus, I'd say this is highly likely, as Norton has a
history of writing bloated crap that ruins your computer and is harder
to uninstall than most viruses.

Virii?
 
JasonS said:
Firstly, some aspects of .NET display handling are slower, but I am more
then happy to occasionally sacrifice performance for the visual inheritance
that the .NET model gives me.

I come from a Delphi background. I've had visual inheritance since about
1996, and the performance of my Delphi UIs (and I construct my .NET UIs
the much the same way as those Delphi UIs) is better.

However, I'm not really willing to give up the benefits of C# 2.0 to use
Delphi again, unless there's a compelling reason (such as a standalone
executable, higher performance graphics or native unmanaged code needed
for performance).

-- Barry
 
Jim said:
I've noticed (for quite some time now) that .Net UIs are not as
responsive (see Franklin Covey's PlanPlus for Windows XP or
Symantec's .Net Norton Antivirus or even the .Net version of Paint
done by Washington University vs good old Paint UIs for examples).

They are also not as professional looking as the older applications
and the reaction times of the UIs is not professional looking at all.

Why do you think this is? Is it bad programming or is there
something else going on here?

Winforms is synchronically, and Win32, which it is based on, is
asynchronically. So, say you want to disable a button in .NET, you set
button.Enabled to false, right? Well, under the hood, a message is send
to the button, and there's a delay when that's handled, the feedback
comes back that the message is handled and hte button is actually
disabled. This is a lot of overhead.

For all the people who claim it's better in WPF: I'm sure it is, but
that's still a long time away and it doesn't help the people today.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
I come from a Delphi background. I've had visual inheritance since about
1996, and the performance of my Delphi UIs (and I construct my .NET UIs
the much the same way as those Delphi UIs) is better.

However, I'm not really willing to give up the benefits of C# 2.0 to use
Delphi again, unless there's a compelling reason (such as a standalone
executable, higher performance graphics or native unmanaged code needed
for performance).

I started using Delphi when it was first released, and I was delighted that
something came out that was object oriented with a nice GUI environment,
but Borland's original policy of charging 50 UK pounds for every technical
support question (and their very limited supplied manuals) meant there was
little likelihood of it being adopted at the banks I was working for,
particularly given that MS support at that time was free.

Borland's UI handling has always been very slick, probably largely due to
the fact most functions call the WinAPI directly without the overheads of
the intermediate functions performed by .NET such as locale specific
formatting, additional security features, visual 'theming' etc, which most
of us don't use but it does make sense to provide.

I wonder what the performance of the new WinFX will be :/

Cheers,
Jason
 
So instead of starting a general discussion, IMO your best bet would be
rather to tell us what you have done that it slow so that one could attempt
to make suggestions to avoid this...

If not already done, you could start with UI code only and see how it
performs, post slow parts etc...
 
As I said in my post, there are several professional applications that you
can see this in.

I was (still am) wondering if this was due to sloppy programming on their
part or was it due to the slowness of the .Net UI.

If you have any ideas about this, I'd love to hear them.
 
Frans Bouma said:
Winforms is synchronically, and Win32, which it is based on, is
asynchronically. So, say you want to disable a button in .NET, you set
button.Enabled to false, right? Well, under the hood, a message is send
to the button, and there's a delay when that's handled, the feedback
comes back that the message is handled and hte button is actually
disabled. This is a lot of overhead.

Yes it is.

It seems that Microsoft is simply adding layer upon layer to thier OS -
which would explain the OS bloat and ever-increasing system requirements.

..Net is an answer to an OS problem anyway. The bufffer overflows that .Net
was meant to handle should be taken care of by the OS....not the programming
langauge and a runtime that lays on top of the OS.

Seems to me that Windows is long overdue for a complete rewrite from the
ground up.

Sure, this would mean breaking backwards compatability with some of the
older stuff, but they could include a personal copy of Virtual PC and allow
the user to run his/her old apps under the old OS while adopting the new,
slimmer, faster, more functional, Windows X and the new programming that it
allows.
For all the people who claim it's better in WPF: I'm sure it is, but
that's still a long time away and it doesn't help the people today.

It's been 5 (IMHO miserable) years with .Net. Nothing really to show for
the effort outside the enterprise (where competition is limited and comtrols
are very tight).

..Net (IMHO) just isn't cutting it as the tool that the COMMUNITY uses to
expand the OS (and that's what you need to build a great OS). It never
should have been written and forced upon us. The problems with buffer
overflows should have been fixed in the OS - then it wouldn't matter what
tool you chose to write your code in.

But......whatever.......

Jim
 
A can of worms was opened with this thread, I believe the core context it is
the next evolution in the C++ vs VB saga, and is continuing. Coupled into
this thread is a reprised villainous assault towards another contributor
tiring the conversation out right and taking from heart of the conversation.



It is what it is, and it is about trade-offs. C++ and VB are not dead,
gone, or otherwise non-employable. Purists can still get the nominal
performance gains back simply be implementing those tools. I do not believe
that performance is all that penalized in the .Net framework and have
several applications under my belt as proof of pudding.



That said, it is about trade-offs, and you trade raw performance with
sophisticated simplicity, true connectedness, and commonality in form and
function. Data binding in VB is a taboo thing, not all controls were data
aware, and inheriting them was complex at best and kludgy at worst. API's
were needed for threading and message handling, while most of the samples
and documents were relegated to the world of C++. The C++ world had to
write their event maps, use the APIs, decide on MFC, STL, ATL, SUV, ACLU and
a few other TLA's, still pointer management was rough, workflow continues to
elude even the veteran developer, and, ick, it's C++.



Enter the world of .Net. Nearly everything you want is there out of the
box. Developers really only have to concentrate on their workflow, business
logic and persistent data management. Additionally, it quelled the qualms
and heated debates as to C++ and VB; they are now on an even playing field.
For raw power, performance, and interoperability; stick with the unmanaged
C++. For ritual, mundane UI development any of the C++, C#, and VB
solutions will suffice in the implementation. All three can talk to one
another without too much special consideration, a benefit and relief for
anyone that survived the COM/DLL HELL days.



The UI components provided out of the box are consistent and complete.
However; you are not tied to the implicit use of those controls including
the winforms. While you have been provided the ability to have access to
all events, messages and awareness, you may and can create your own set of
UI components from the ground up inheriting right from System.Object.
Synchronous/Asynchronous, bah who cares, if you don't like red kool-aid, try
the purple.



You may be stuck with deploying the whole framework; however, you are not
tied to the whole framework. And still, this conversation assumes that the
performance hit is such that it bothers the user. ACT is an example of
something funky going on in the .Net world; however I think it has more to
do with data then the interface.



There are not a lot of commercial applications out there that I know of,
that employ .Net. Those that are out there, I wonder about the teams that
employ them, were they trying to stick to the old ways and not taking full
advantage of the new features? What about the code base, was a direct port
from earlier works or was it optimized and tweaked. Did they clean up
disposable object, release resources? Just because it is in commercial
release doesn't make it right, take a look at Windows ME's longevity and
acceptance.



..Net is the necessary evil in my world. A development tool it not always
the most technically proficient bearer of results. Why use .Net when Office
will work? Why use .Net when windows scheduler will suffice? Why drink Bud
Dry? All decisions are influenced by external sources and not always the
right ones, why else would a normal human being pay thousands for a wiper
blade for a government aircraft?



In an experiment, I have created a VB application and a VB.Net application.
One form with one button each. The button launches five new instances of
the form. Using tick count, the times appear very similar. What are
specifically seems slow and sluggish in your application?



I am running out of steam, so I will close with this. Public ridicule
chastising public ridicule discredits your ability to ask serious questions
and weakens your perceived insight in future discussions, reiterating your
contempt was just petty, childish and low.



I don't know Cor, but I know of his work and involvement in the community.
Right or wrong, he and others are there to assist and help. They do so, and
people are resolving their issues. Yes, he may be doctrinated and advocates
his views in his responses, but doesn't a professor do the same when asked
to impart his knowledge?



When a co-worker annoys you, do you say so publicly? When someone at Burger
King steps on your toes, twice, do you make a loud rebuke? Professional
courtesy says you debate the points, agree to disagree, or just keep quite.
Common courtesy says you apologize for the terse, personal, and unwanted
comments.
 
Despite being a fan of .NET (from a programmer-- ease of development
standpoint) I tend to agree with almost everything you say. Windows is due
for a big rewrite a la MacOS X.... I doubt MS has the guts to do it.
 
VB Classic made brilliant use of light-weight (not "real"... as in not
having hWnds) controls (The label, image, and shape controls) that were
painted by the VB Runtime and not handled by the OS. In .NET everything has
an underlying hWnd control underneath. These creates some "robustness" but
also introduces some bad performance... hWnd controls really are
"Windows".... they're created using the same API (CreateWindowEx) as "Forms"
and when an app has too many of them it quickly degrades in performance.
 
Back
Top