473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

EXE file size: managed C++ vs C#

I created two absolutely identical projects (one form, two buttons rise
two MessageBoxes) - one in managed C++ and second in C# (bough are .NET
1.1). Size of executable files I got were 76K-release/136K-debug in C++
and 20K/20K in C#. I didn't expect absolutely same size. Just wondering
why C++ exe more than three times bigger than C#?
Thanks!

--
Vit Zayko
Nov 17 '05 #1
6 2341
Vitaly,

I saw that VBNet can have even smaller exe's.

I assume that what every team build around it is the reason for it.

A simple test is of course to create in all Net four languages a form
application withouth any code and than to see what is in the exe.

(My expirience about C# and VBNet showed that the differences are not
stable. I saw it in the way I showed it above).

Cor
Nov 17 '05 #2
Hi,

What amount of code your c++ project is?

How many lines the source code has?

I would compare c# more to VB.NET than to C++ , ( I may be flamed for this
comment in this NG :) )

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Vitaly Zayko" <vitaly_at_zayko_dot_net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I created two absolutely identical projects (one form, two buttons rise two
MessageBoxes) - one in managed C++ and second in C# (bough are .NET 1.1).
Size of executable files I got were 76K-release/136K-debug in C++ and
20K/20K in C#. I didn't expect absolutely same size. Just wondering why C++
exe more than three times bigger than C#?
Thanks!

--
Vit Zayko

Nov 17 '05 #3
It's just one form with two buttons on it. Each button opens MessageBox
with 18 bytes text and 4 bytes title. Anything else is default.
C++ has 100 lines includes default comments (Form1.h)
C# has 111 lines (Form1.cs)
I didn't use VB for last 10 years. But I know C++ and learning C#. I'm
still in dark which one to take as primary. That's why I make tests
time to time.

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

What amount of code your c++ project is?

How many lines the source code has?

I would compare c# more to VB.NET than to C++ , ( I may be flamed for this
comment in this NG :) )

cheers,

--
Vit Zayko
Nov 17 '05 #4
Hi,

In these times of 500 GB a HDD what is 100Kb ?

IMO you better concentrate in other metrics:
1- Knowledge of the languages
2- Market requests
3- Personal expectations
4- Consult a fortuneteller :) or maybe a luck cookie :)

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vitaly Zayko" <vitaly_at_zayko_dot_net> wrote in message
news:ON**************@TK2MSFTNGP10.phx.gbl...
It's just one form with two buttons on it. Each button opens MessageBox
with 18 bytes text and 4 bytes title. Anything else is default.
C++ has 100 lines includes default comments (Form1.h)
C# has 111 lines (Form1.cs)
I didn't use VB for last 10 years. But I know C++ and learning C#. I'm
still in dark which one to take as primary. That's why I make tests time
to time.

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

What amount of code your c++ project is?

How many lines the source code has?

I would compare c# more to VB.NET than to C++ , ( I may be flamed for
this comment in this NG :) )

cheers,

--
Vit Zayko

Nov 17 '05 #5
That's probably because I do pure C for embedded past two years :)
Seriously: I'm trying to understand which language is better for which
purpose. That was just one test from several others. I wrote this thread
because results I got are so unexpected for me. I agree: size is no
longer matter :))

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

In these times of 500 GB a HDD what is 100Kb ?

IMO you better concentrate in other metrics:
1- Knowledge of the languages
2- Market requests
3- Personal expectations
4- Consult a fortuneteller :) or maybe a luck cookie :)

cheers,

--
Vit Zayko
Nov 17 '05 #6
Because the ME C++ version has C runtime code linked in, this is going away
when you are using C++/CLI in safe mode. Note that the MEC++ version cannot
generate verifiable code.
Willy.

"Vitaly Zayko" <vitaly_at_zayko_dot_net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I created two absolutely identical projects (one form, two buttons rise two
MessageBoxes) - one in managed C++ and second in C# (bough are .NET 1.1).
Size of executable files I got were 76K-release/136K-debug in C++ and
20K/20K in C#. I didn't expect absolutely same size. Just wondering why C++
exe more than three times bigger than C#?
Thanks!

--
Vit Zayko

Nov 17 '05 #7

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

Similar topics

26
by: Michel Rouzic | last post by:
I have a binary file used to store the values of variables in order to use them again. I easily know whether the file exists or not, but the problem is, in case the program has been earlier...
1
by: Jón Sveinsson | last post by:
Hello everyone I have been trying to read and write struct to binary files, I'm using to functions to convert the struct to bytes and bytes to struct, I always receive the following error ...
7
by: Lei Jiang | last post by:
I'd like to calculate the memory size that my data structure cost, but I could not find any API that I could calculate the size of an object. Could anyone give me a work around? Thanks!
2
by: vikas | last post by:
I have following structure in c++. typedef struct MMF_result_struct { int action; char text; int cols,rows; int month,day,year; } MMF_result; Now this structure is shared between C++ and C#...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
14
by: Al Smith | last post by:
I need help in implementing proper error handling. I am trying to upload a file based on the sample code below. The code works well except if the file selected is too big. I do know about the...
0
by: Adam Parker | last post by:
I am in the process of writing a simple web server monitor (ASP.Net with VB.Net). One piece of useful information for me to gather would be the amount of memory used by objects stored in the...
0
by: Ken Varn | last post by:
I have a managed C++ assembly in which I need to interact with some 'C' APIs that take fixed size 'C' data blocks. I need to wrap these data blocks into a managed object. It seems like a lot of...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.