473,698 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Improving performance C++/C#

Because of historical reasons, I have both C# and C++ managed/unmanaged code
mixed together in my class library.
But I prefer to port code to C# since it compiles faster and the syntax is
much more readable so I can do more in less time.

The big question now, will I gain/lose performance, given the fact that I
create pure managed code, if I port the managed C++ classes to C# classes? I
cannot port all the classes at once, too much to port, not enough time.

I use the C++ and C# standard edition 2003. For C++ no speed optimizing is
possible, but since C# uses the C# compiler from the .NET framework, I might
have faster speed this way?
Nov 17 '05
29 1789
Olaf Baeyens wrote:
Compiles much faster. :-)
This compile time is what slows me down because of the huge number of lines
in my class library.


Yes VC++ compilation may be slower (since) but more compile time
optimisations take place.

--
Ioannis Vranos
Nov 17 '05 #11
> > My tests so far are closer to 10% between managed and unmanaged. But I
think
it depends what you do.


I am talking only about pure IL code.

And since on the subject let me give some examples of language strength:

Can you do this kind of thing in C# at *compile time*, producing 100%
verifiable code?


Very nice, but now is the question do we really need this?
The part that I am porting is not very critical in speed for the end-user.
But it helps me compiling faster, reducing development time.
Nov 17 '05 #12
Olaf Baeyens wrote:
My tests so far are closer to 10% between managed and unmanaged. But I
think
it depends what you do.
I am talking only about pure IL code.

And since on the subject let me give some examples of language strength:

Can you do this kind of thing in C# at *compile time*, producing 100%
verifiable code?

Very nice, but now is the question do we really need this?

Yes. Especially to write compile-time optimal generic facilities to be
placed in libraries. :-)

Generics will be run-time and more limiting.


The part that I am porting is not very critical in speed for the end-user.
But it helps me compiling faster, reducing development time.

Anyway. :-)

--
Ioannis Vranos
Nov 17 '05 #13
> > Very nice, but now is the question do we really need this?

Yes. Especially to write compile-time optimal generic facilities to be
placed in libraries. :-)

Generics will be run-time and more limiting.


Don't worry, I still use C++. ;-)
It is only parts of the code that gets ported.

I am busy right now doing the (partial) port, and I already feel it that I
can compile faster.
With no noticible slow down of the program.

I am wondering how long C++ will stay here since all languages tend to move
to .NET framework so the speed will become more and more the same.
Sooner or later one .NET language will use components from other .NET
languages and we will have one big pool with components.

I believe that unmanaged C++ will be phased out just like assembler did at
some future point of time.
Assembler still exists, just integrated into C++.
Nov 17 '05 #14
Olaf Baeyens wrote:
I am wondering how long C++ will stay here since all languages tend to move
to .NET framework so the speed will become more and more the same.
Sooner or later one .NET language will use components from other .NET
languages and we will have one big pool with components.

I believe that unmanaged C++ will be phased out just like assembler did at
some future point of time.
Assembler still exists, just integrated into C++.

Again, previously I was not talking about native C++ but for pure
managed CLI (.NET) code.

Native code will always be around.
In addition, in Longhorn edition of VS (code named Orcas), these 4
things will be possible:
CLI types in managed heap/stack (available today / VC++ 2005)

Native types in unmanaged heap/stack (available today)

CLI types in *unmanaged heap*.

Native types in *managed heap*.

--
Ioannis Vranos
Nov 17 '05 #15
Olaf Baeyens wrote:
I am busy right now doing the (partial) port, and I already feel it
that I can compile faster.


My $0.02 worth:

The C# compiler is quite speedy and easy to use on smallish projects, but
when the project gets large (100's to 1000's of source files), the lack of a
real incremental build tips heaviliy in favor of C++ (except for
Rebuild-All, of course).

In the end, it's hard to say which compiler will slow you down more.

-cd
Nov 17 '05 #16
Carl,
The C# compiler is quite speedy and easy to use on smallish projects, but
when the project gets large (100's to 1000's of source files), the lack of a real incremental build tips heaviliy in favor of C++ (except for
Rebuild-All, of course).


My own experience is that, with a decent machine (not super, just fairly
decent), we can recompile one of our project's code bases from scratch
(consisting of about 50.000 lines of code and about 250 source files that
compile into about 25 dlls) in less than a minute with the C# compiler. The
larger code base (around 250.000 lines of code) used to be compilable from
scratch in a couple of minutes or so...

It's not bad, really. However, the project model, overall, usually causes a
fairly big recompile when you change one of the bottom dependencies, which
can slow the process down.
--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #17
> > The C# compiler is quite speedy and easy to use on smallish projects,
but
when the project gets large (100's to 1000's of source files), the lack
of a
real incremental build tips heaviliy in favor of C++ (except for
Rebuild-All, of course).
My own experience is that, with a decent machine (not super, just fairly
decent), we can recompile one of our project's code bases from scratch
(consisting of about 50.000 lines of code and about 250 source files that
compile into about 25 dlls) in less than a minute with the C# compiler.

The larger code base (around 250.000 lines of code) used to be compilable from
scratch in a couple of minutes or so...

It's not bad, really. However, the project model, overall, usually causes a fairly big recompile when you change one of the bottom dependencies, which
can slow the process down.

The same is true in C++. Change one constant, or accidentily type a space in
one of the base headers and I am off agin for another 17 minute recompile.
I have a code base of about 180.000 lines now.

If the C++ people could find a way to avoid this "#include system" and use
the C# like technology then it would help a lot from developer viewpoint in
speeding up development.
Nov 17 '05 #18
Olaf Baeyens wrote:
The same is true in C++. Change one constant, or accidentily type a
space in one of the base headers and I am off agin for another 17
minute recompile. I have a code base of about 180.000 lines now.
Changing a widely included header does cause great pain. Of course, a great
deal (a very great deal actually) of that pain can be mitigated by proper
construction and use of header files to minimize coupling and dependencies
(read John Lackos - "Large Scale C++ Development" for lots of
recommendations ). Nonetheless, when you have to change something at the
lowest level, it hurts - no denying it.
If the C++ people could find a way to avoid this "#include system"
and use the C# like technology then it would help a lot from
developer viewpoint in speeding up development.


Some day. Maybe. Unfortunately, compatibility with C has us stuck with a
primitive text splicing mechanism instead of a real module concept.
Personally, I think this is an area where a vendor, such as Microsoft, needs
to step in and build a well thought-out module mechanism that can replace
the preprocessor for most (but probably not all) use. Only then is there a
real chance that the C++ community at large will finally move on this issue.
It's been discussed for over a decade now and nothing's happened.

To an extent, this is already happening with .NET.

-cd
Nov 17 '05 #19
Carl Daniel [VC++ MVP] wrote:
Some day. Maybe. Unfortunately, compatibility with C has us stuck with a
primitive text splicing mechanism instead of a real module concept.
Personally, I think this is an area where a vendor, such as Microsoft, needs
to step in and build a well thought-out module mechanism that can replace
the preprocessor for most (but probably not all) use. Only then is there a
real chance that the C++ community at large will finally move on this issue.
It's been discussed for over a decade now and nothing's happened.

To an extent, this is already happening with .NET.

What mechanism does C# provide for inclusion of source code files?

--
Ioannis Vranos
Nov 17 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
949
by: Andy Tran | last post by:
I built a system using mysql innodb to archive SMS messages but the innodb databases are not keeping up with the number of SMS messages coming in. I'm looking for performance of 200 msgs/sec where 1 msg is 1 database row. I'm running on Red Linux: 2.4.20-8bigmem #1 SMP Thu Mar 13 17:32:29 EST 2003 i686 i686 i386 GNU/Linux The machine has dual CPU and 2G of RAM.
14
3707
by: Ron Johnson | last post by:
Hi, While on the topic of "need for in-place upgrades", I got to think- ing how the pg_restore could be speeded up. Am I wrong in saying that in the current pg_restore, all of the indexes are created in serial? How about this new, multi-threaded way of doing the pg_restore: 0. On the command line, you specify how many threads you want.
8
2491
by: murphy | last post by:
I'm programming a site that displays info from AWS Commerce Service 4.0. At each change of the asp.net application the first load of a page that uses the web service takes 30 seconds. Subsequent calls are snappy. From what I've learned this overhead is for processing the wsdl file (which has of course not changed). The file is large, 2200 lines. Is there a way to use this file locally on the web server or cache the result of the...
1
1344
by: Brian Basquille | last post by:
Hello all. Have been working on the Air Hockey game on and off for a couple of weeks now.. but have had plenty of other assignments to keep me busy along with it. But i would like some suggestions on improving it. It's far from fully working, but some suggestions on the following would be great. Please download it from: http://homepage.eircom.net/~basquilletj/AirHockey.rar.
1
1139
by: Robin | last post by:
For an asp.net project that is deployed to a load balanced web servers, are there any performance changes that can be made in .Net runtime or IIS 6? Also are there any additional tips for reviewing the asp.net (VB) code for improving performance?
1
1994
by: Larry Neylon | last post by:
Hi, I'm working on a VBScript application on IIS6 and I'm looking for some advice about the best way of replacing or improving session variable usage. The application is in a secure extranet environment. Currently the application has a search customers page with 10 search fields which list the results below the search fields. The requirement for this screen was that the user could return to this result page at any point from any page...
1
1519
by: mjheitland | last post by:
Hello, does anyone know if an update is available (or at least planned) for the much cited standard reference IMPROVING .NET APPLICATION PERFORMANCE AND SCALABILITY? link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenet.asp or as a download:
5
2432
by: Rahul B | last post by:
Hi, We have been migrating to DB2 and it has been the trend that the application has become somewhat slow. It could be because of the application problems or it could be because i am not very aware of how to try to improve the performance of the DB2. The only thing i am aware is about the RunStats utility. Can somebody give me various steps that i can take to try to improve
3
12326
by: Michel Esber | last post by:
Hello, Environment: DB2 LUW v8 FP15 / Linux I have a table with 50+ Million rows. The table structure is basically (ID - Timestamp). I have two main applications - one inserting rows, and the other reading/deleting rows. The 'deleter' application runs a MIN/MAX (timestamp) for each ID and, if the difference between min/max is greater than 1h, it reads all
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.