By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 3,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

Perfomance using .NET vs. Borland

P: n/a
TGF
I am wondering if it is feasible to use .NET for applications that have to
be very fast. We have a few applications that are blazingly fast, written
in Borland C++ using Borland C++ Builder. We would like to port over to
..NET, but some of the test models we have developed are MUCH, MUCH slower
than it's Borland counterpart. Is this due to the .NET Framework and the
JIT? Or is it something we should be looking for in the project settings
and/or compiler settings? The performance decrease is about two-fold.

--
TGF

Jul 21 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
I am wondering if it is feasible to use .NET for applications that have to
be very fast. We have a few applications that are blazingly fast, written
in Borland C++ using Borland C++ Builder. We would like to port over to
.NET, but some of the test models we have developed are MUCH, MUCH slower
than it's Borland counterpart. Is this due to the .NET Framework and the
JIT? Or is it something we should be looking for in the project settings
and/or compiler settings? The performance decrease is about two-fold.

--
TGF

What kind of applications are we talking about? Windows, console, etc.?
You are aware that you aren't limited to .NET Framework-dependent
application types in Visual Studio .NET, correct? IOW, you can create
straight Windows API applications, or MFC applications, or straight console
applications. You may be comparing apples to oranges.

--
Peter - [MVP - Academic]
Jul 21 '05 #2

P: n/a
TGF
Peter,

I am talking about a .NET Windows Form C++ Application using the managed
extensions. Specifically, I have a RichTextBox component that is to be
updated, line by line very very quickly. In the Borland C++ Builder app I
have created, it is blindingly fast (this is good). In the .NET Windows
Forms application, it is painfully slow. The code is pretty much the same,
albeit compensating for the managed extensions in .NET. Is this slowdown to
be expected (due to the .NET framework), or am I missing something?

-TGF
"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
I am wondering if it is feasible to use .NET for applications that have to be very fast. We have a few applications that are blazingly fast, written in Borland C++ using Borland C++ Builder. We would like to port over to
.NET, but some of the test models we have developed are MUCH, MUCH slower than it's Borland counterpart. Is this due to the .NET Framework and the JIT? Or is it something we should be looking for in the project settings and/or compiler settings? The performance decrease is about two-fold.

--
TGF

What kind of applications are we talking about? Windows, console, etc.?
You are aware that you aren't limited to .NET Framework-dependent
application types in Visual Studio .NET, correct? IOW, you can create
straight Windows API applications, or MFC applications, or straight

console applications. You may be comparing apples to oranges.

--
Peter - [MVP - Academic]

Jul 21 '05 #3

P: n/a

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:O0**************@TK2MSFTNGP11.phx.gbl...
Peter,

I am talking about a .NET Windows Form C++ Application using the managed extensions. Specifically, I have a RichTextBox component that is to be
updated, line by line very very quickly. In the Borland C++ Builder app I
have created, it is blindingly fast (this is good). In the .NET Windows
Forms application, it is painfully slow. The code is pretty much the same, albeit compensating for the managed extensions in .NET. Is this slowdown to be expected (due to the .NET framework), or am I missing something?

-TGF

I'm still confused. You're building a Visual Studio .NET 2003 C++ Windows
Form template application, and comparing it to what type of application
produced in Borland C++ Builder? What technology does the Borland app
employ? OWL? MFC? API calls?
Regardless, I'm probably not the right person to address your question, as
all I can provide is limited, anecdotal evidence of a few test WinForm apps
that employ textboxes, single and multi-line, rich text boxes, list boxes,
etc that don't show any noticeable performance deteriorations in comparison
to earlier examples using MFC. That doesn't mean it can't happen, but
someone would have to look at exactly what is going on in your application
to provide a meaningful response.
Hopefully, someone else with more specific experience will jump into the
thread.

--
************************************************** ********************
** All opinions are mine alone.Do not attribute elsewhere!
************************************************** ********************
** Peter van der Goes, Professor, Computers & Information Technology
** Rose State College
*********************** Contact ************************************
** Office e-mail: pv**@rose.edu
** Home e-mail: p_**********@cox.net
** Web Page: http://www.rose.edu/Faculty/pvan/index.htm
************************************************** ********************
Jul 21 '05 #4

P: n/a
AFAIK, Windows Forms (at least parts of System.Drawing) don't get hardware
accelleration. This is based on old information, so it might be incorrect
:S.

Are you using the same control in both scenarios? Are you sure you don't
have any optmization code in your Borland project that's helping out?

For updating a control, I'd recommend disabling repainting of it, update it,
and then repaint it. Making it perform multiple repaints in rapid
succession can be rather slow.

-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:O0**************@TK2MSFTNGP11.phx.gbl...
Peter,

I am talking about a .NET Windows Form C++ Application using the managed extensions. Specifically, I have a RichTextBox component that is to be
updated, line by line very very quickly. In the Borland C++ Builder app I
have created, it is blindingly fast (this is good). In the .NET Windows
Forms application, it is painfully slow. The code is pretty much the same, albeit compensating for the managed extensions in .NET. Is this slowdown to be expected (due to the .NET framework), or am I missing something?

-TGF
"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
I am wondering if it is feasible to use .NET for applications that have
to
be very fast. We have a few applications that are blazingly fast, written in Borland C++ using Borland C++ Builder. We would like to port over
to .NET, but some of the test models we have developed are MUCH, MUCH

slower than it's Borland counterpart. Is this due to the .NET Framework and the JIT? Or is it something we should be looking for in the project settings and/or compiler settings? The performance decrease is about two-fold.

--
TGF

What kind of applications are we talking about? Windows, console, etc.?
You are aware that you aren't limited to .NET Framework-dependent
application types in Visual Studio .NET, correct? IOW, you can create
straight Windows API applications, or MFC applications, or straight

console
applications. You may be comparing apples to oranges.

--
Peter - [MVP - Academic]



Jul 21 '05 #5

P: n/a

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:u$****************@TK2MSFTNGP12.phx.gbl...
AFAIK, Windows Forms (at least parts of System.Drawing) don't get hardware
accelleration. This is based on old information, so it might be incorrect
:S.

Are you using the same control in both scenarios? Are you sure you don't
have any optmization code in your Borland project that's helping out?

For updating a control, I'd recommend disabling repainting of it, update it, and then repaint it. Making it perform multiple repaints in rapid
succession can be rather slow.

-mike
MVP

Mike, perhaps you can clear something up for me.
I was under the impression that the OP was using the new Windows Form
Application (.NET)template in VS.NET 2003 and comparing the "slowness" of it
to a similar project built in Borland C++ Builder. I did a little research
on C++ Builder, and did not see any indication that it supports the .NET
framework (at least not so stated on the Borland product page), let alone
feature an analog to the Windows Form (.NET) template? That's why I wanted
the OP to tell us if he was using OWL, MFC or whatever. Am I out in left
field on this?
Thanks in advance.
Jul 21 '05 #6

P: n/a
I don't know much about Borlands solutions either (but I do believe they
have some .NET offering). I do know that Windows Forms wraps some common
controls with a layer of managed code. I guess I'm seconding your question
about the actual environment to make sure this is an apples to apples
comparison.

-mike
MVP

"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:u$****************@TK2MSFTNGP12.phx.gbl...
AFAIK, Windows Forms (at least parts of System.Drawing) don't get hardware accelleration. This is based on old information, so it might be incorrect :S.

Are you using the same control in both scenarios? Are you sure you don't have any optmization code in your Borland project that's helping out?

For updating a control, I'd recommend disabling repainting of it, update it,
and then repaint it. Making it perform multiple repaints in rapid
succession can be rather slow.

-mike
MVP

Mike, perhaps you can clear something up for me.
I was under the impression that the OP was using the new Windows Form
Application (.NET)template in VS.NET 2003 and comparing the "slowness" of

it to a similar project built in Borland C++ Builder. I did a little research
on C++ Builder, and did not see any indication that it supports the .NET
framework (at least not so stated on the Borland product page), let alone
feature an analog to the Windows Form (.NET) template? That's why I wanted the OP to tell us if he was using OWL, MFC or whatever. Am I out in left
field on this?
Thanks in advance.

Jul 21 '05 #7

P: n/a
TGF
Guys:

The Borland environment I was using is basically a "Non .NET" forms
based IDE. The support for form in Borland Builder seems to be much better.
The Borland classes that make it possible are basically wrappers around MS
MFC's. Not my choice to switch to .NET, but have to go with it nonetheless.
It seems maybe because of the .NET framework (MSIL use), the RichTextBox
component is not able to AppendText() as quickly as it's MFC counterpart.
Is this the case that you guys see? I did a test with a Timer component
calling a Tick event every 1ms. This is a bare bones form that I did the
test on. The RichTextBox was able to do about 100 lines a second compared
to about 500 lines a second using Borland C++ Builder.

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I don't know much about Borlands solutions either (but I do believe they
have some .NET offering). I do know that Windows Forms wraps some common
controls with a layer of managed code. I guess I'm seconding your question about the actual environment to make sure this is an apples to apples
comparison.

-mike
MVP

"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:u$****************@TK2MSFTNGP12.phx.gbl...
AFAIK, Windows Forms (at least parts of System.Drawing) don't get hardware accelleration. This is based on old information, so it might be incorrect :S.

Are you using the same control in both scenarios? Are you sure you don't have any optmization code in your Borland project that's helping out?

For updating a control, I'd recommend disabling repainting of it,
update it,
and then repaint it. Making it perform multiple repaints in rapid
succession can be rather slow.

-mike
MVP
Mike, perhaps you can clear something up for me.
I was under the impression that the OP was using the new Windows Form
Application (.NET)template in VS.NET 2003 and comparing the "slowness" of it
to a similar project built in Borland C++ Builder. I did a little

research on C++ Builder, and did not see any indication that it supports the .NET
framework (at least not so stated on the Borland product page), let alone feature an analog to the Windows Form (.NET) template? That's why I

wanted
the OP to tell us if he was using OWL, MFC or whatever. Am I out in left
field on this?
Thanks in advance.


Jul 21 '05 #8

P: n/a
Did you turn off painting while updating?
-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Guys:

The Borland environment I was using is basically a "Non .NET" forms
based IDE. The support for form in Borland Builder seems to be much better. The Borland classes that make it possible are basically wrappers around MS
MFC's. Not my choice to switch to .NET, but have to go with it nonetheless. It seems maybe because of the .NET framework (MSIL use), the RichTextBox
component is not able to AppendText() as quickly as it's MFC counterpart.
Is this the case that you guys see? I did a test with a Timer component
calling a Tick event every 1ms. This is a bare bones form that I did the
test on. The RichTextBox was able to do about 100 lines a second compared
to about 500 lines a second using Borland C++ Builder.

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I don't know much about Borlands solutions either (but I do believe they
have some .NET offering). I do know that Windows Forms wraps some common
controls with a layer of managed code. I guess I'm seconding your

question
about the actual environment to make sure this is an apples to apples
comparison.

-mike
MVP

"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:u$****************@TK2MSFTNGP12.phx.gbl...
> AFAIK, Windows Forms (at least parts of System.Drawing) don't get

hardware
> accelleration. This is based on old information, so it might be

incorrect
> :S.
>
> Are you using the same control in both scenarios? Are you sure you

don't
> have any optmization code in your Borland project that's helping out? >
> For updating a control, I'd recommend disabling repainting of it,

update it,
> and then repaint it. Making it perform multiple repaints in rapid
> succession can be rather slow.
>
> -mike
> MVP
>
Mike, perhaps you can clear something up for me.
I was under the impression that the OP was using the new Windows Form
Application (.NET)template in VS.NET 2003 and comparing the "slowness" of
it
to a similar project built in Borland C++ Builder. I did a little

research on C++ Builder, and did not see any indication that it supports the ..NET framework (at least not so stated on the Borland product page), let alone feature an analog to the Windows Form (.NET) template? That's why I

wanted
the OP to tell us if he was using OWL, MFC or whatever. Am I out in left field on this?
Thanks in advance.



Jul 21 '05 #9

P: n/a
TGF
No, how do I do that?

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ow**************@TK2MSFTNGP11.phx.gbl...
Did you turn off painting while updating?
-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Guys:

The Borland environment I was using is basically a "Non .NET" forms
based IDE. The support for form in Borland Builder seems to be much

better.
The Borland classes that make it possible are basically wrappers around MS
MFC's. Not my choice to switch to .NET, but have to go with it

nonetheless.
It seems maybe because of the .NET framework (MSIL use), the RichTextBox
component is not able to AppendText() as quickly as it's MFC counterpart. Is this the case that you guys see? I did a test with a Timer component
calling a Tick event every 1ms. This is a bare bones form that I did the test on. The RichTextBox was able to do about 100 lines a second compared to about 500 lines a second using Borland C++ Builder.

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I don't know much about Borlands solutions either (but I do believe they have some .NET offering). I do know that Windows Forms wraps some common controls with a layer of managed code. I guess I'm seconding your

question
about the actual environment to make sure this is an apples to apples
comparison.

-mike
MVP

"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
>
> "Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
> news:u$****************@TK2MSFTNGP12.phx.gbl...
> > AFAIK, Windows Forms (at least parts of System.Drawing) don't get
hardware
> > accelleration. This is based on old information, so it might be
incorrect
> > :S.
> >
> > Are you using the same control in both scenarios? Are you sure you don't
> > have any optmization code in your Borland project that's helping out? > >
> > For updating a control, I'd recommend disabling repainting of it,

update
> it,
> > and then repaint it. Making it perform multiple repaints in rapid
> > succession can be rather slow.
> >
> > -mike
> > MVP
> >
> Mike, perhaps you can clear something up for me.
> I was under the impression that the OP was using the new Windows Form > Application (.NET)template in VS.NET 2003 and comparing the
"slowness" of
it
> to a similar project built in Borland C++ Builder. I did a little

research
> on C++ Builder, and did not see any indication that it supports the

.NET > framework (at least not so stated on the Borland product page), let

alone
> feature an analog to the Windows Form (.NET) template? That's why I
wanted
> the OP to tell us if he was using OWL, MFC or whatever. Am I out in left > field on this?
> Thanks in advance.
>
>



Jul 21 '05 #10

P: n/a
You could try disabling or making it invisible. If not, try subclassing it,
override the Paint method and add a boolean property "IsUpdating". While
it's updating, you don't paint.

I'm curious as to why you are adding new text to an RTFBox so quickly?
Couldn't you buffer your output and then write a large chunk every few
seconds or more?

-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
No, how do I do that?

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ow**************@TK2MSFTNGP11.phx.gbl...
Did you turn off painting while updating?
-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
Guys:

The Borland environment I was using is basically a "Non .NET" forms based IDE. The support for form in Borland Builder seems to be much better.
The Borland classes that make it possible are basically wrappers around MS
MFC's. Not my choice to switch to .NET, but have to go with it

nonetheless.
It seems maybe because of the .NET framework (MSIL use), the
RichTextBox component is not able to AppendText() as quickly as it's MFC counterpart. Is this the case that you guys see? I did a test with a Timer component calling a Tick event every 1ms. This is a bare bones form that I did the test on. The RichTextBox was able to do about 100 lines a second compared to about 500 lines a second using Borland C++ Builder.

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> I don't know much about Borlands solutions either (but I do believe they > have some .NET offering). I do know that Windows Forms wraps some

common
> controls with a layer of managed code. I guess I'm seconding your
question
> about the actual environment to make sure this is an apples to apples > comparison.
>
> -mike
> MVP
>
> "Peter van der Goes" <p_**********@mars.cox.net> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
> >
> > "Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message > > news:u$****************@TK2MSFTNGP12.phx.gbl...
> > > AFAIK, Windows Forms (at least parts of System.Drawing) don't get > hardware
> > > accelleration. This is based on old information, so it might be
> incorrect
> > > :S.
> > >
> > > Are you using the same control in both scenarios? Are you sure you > don't
> > > have any optmization code in your Borland project that's helping

out?
> > >
> > > For updating a control, I'd recommend disabling repainting of it, update
> > it,
> > > and then repaint it. Making it perform multiple repaints in rapid > > > succession can be rather slow.
> > >
> > > -mike
> > > MVP
> > >
> > Mike, perhaps you can clear something up for me.
> > I was under the impression that the OP was using the new Windows Form > > Application (.NET)template in VS.NET 2003 and comparing the "slowness" of
> it
> > to a similar project built in Borland C++ Builder. I did a little
research
> > on C++ Builder, and did not see any indication that it supports the .NET
> > framework (at least not so stated on the Borland product page),
let alone
> > feature an analog to the Windows Form (.NET) template? That's why I > wanted
> > the OP to tell us if he was using OWL, MFC or whatever. Am I out

in left
> > field on this?
> > Thanks in advance.
> >
> >
>
>



Jul 21 '05 #11

P: n/a
TGF
Mike,

The reason I have to update it so quickly is because it is reading data in a
binary form from a flat file that has an internal directory structure....So
while it is possible to and might be the only solution, to update every 10
lines or so, it would be MUCH nices to have a line by line output, but thats
the breaks, I guess.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl...
You could try disabling or making it invisible. If not, try subclassing it, override the Paint method and add a boolean property "IsUpdating". While
it's updating, you don't paint.

I'm curious as to why you are adding new text to an RTFBox so quickly?
Couldn't you buffer your output and then write a large chunk every few
seconds or more?

-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
No, how do I do that?

-TGF
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ow**************@TK2MSFTNGP11.phx.gbl...
Did you turn off painting while updating?
-mike
MVP

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl...
> Guys:
>
> The Borland environment I was using is basically a "Non .NET" forms > based IDE. The support for form in Borland Builder seems to be much
better.
> The Borland classes that make it possible are basically wrappers around
MS
> MFC's. Not my choice to switch to .NET, but have to go with it
nonetheless.
> It seems maybe because of the .NET framework (MSIL use), the RichTextBox > component is not able to AppendText() as quickly as it's MFC counterpart.
> Is this the case that you guys see? I did a test with a Timer component > calling a Tick event every 1ms. This is a bare bones form that I did the
> test on. The RichTextBox was able to do about 100 lines a second

compared
> to about 500 lines a second using Borland C++ Builder.
>
> -TGF
>
>
> "Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
> news:%2****************@TK2MSFTNGP12.phx.gbl...
> > I don't know much about Borlands solutions either (but I do
believe
they
> > have some .NET offering). I do know that Windows Forms wraps some
common
> > controls with a layer of managed code. I guess I'm seconding your
> question
> > about the actual environment to make sure this is an apples to apples > > comparison.
> >
> > -mike
> > MVP
> >
> > "Peter van der Goes" <p_**********@mars.cox.net> wrote in message
> > news:%2****************@TK2MSFTNGP11.phx.gbl...
> > >
> > > "Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message > > > news:u$****************@TK2MSFTNGP12.phx.gbl...
> > > > AFAIK, Windows Forms (at least parts of System.Drawing) don't get > > hardware
> > > > accelleration. This is based on old information, so it might
be > > incorrect
> > > > :S.
> > > >
> > > > Are you using the same control in both scenarios? Are you sure you
> > don't
> > > > have any optmization code in your Borland project that's

helping out?
> > > >
> > > > For updating a control, I'd recommend disabling repainting of

it, > update
> > > it,
> > > > and then repaint it. Making it perform multiple repaints in rapid > > > > succession can be rather slow.
> > > >
> > > > -mike
> > > > MVP
> > > >
> > > Mike, perhaps you can clear something up for me.
> > > I was under the impression that the OP was using the new Windows

Form
> > > Application (.NET)template in VS.NET 2003 and comparing the

"slowness"
> of
> > it
> > > to a similar project built in Borland C++ Builder. I did a little > research
> > > on C++ Builder, and did not see any indication that it supports the .NET
> > > framework (at least not so stated on the Borland product page), let > alone
> > > feature an analog to the Windows Form (.NET) template? That's
why I > > wanted
> > > the OP to tell us if he was using OWL, MFC or whatever. Am I out in left
> > > field on this?
> > > Thanks in advance.
> > >
> > >
> >
> >
>
>



Jul 21 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.