473,848 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different C++ compiler exec. sizes

Out of curiosity, I wanted to test executable file sizes of the same
program from different compilers...

The 2 compilers I tested (both old, on purpose) were Borland C++ 3.1
and DJGPP 2.03...

The program was nothing but a simple hello world program using the
iostream header file...

I compiled and linked (both copies) with those 2 different
compilers... The Borland c++ 3.1 compiler gave me an executable with
size like 20-30KB (i don't remember) and DJGPP gave me an executable
with size like 220-240KB...

I can assume 2 things here... Either DJGPP produces WAY more
compicated executables (kind of odd though) or DJGPP's header files
contain kinda different info....

Anyone seen anything like that? Anyone know why?
Jul 19 '05
11 6708

"Jerry Coffin" <jc*****@taeus. com> wrote in message news:MP******** *************** *@news.clspco.a delphia.net...
[snip]
It starts to go wrong at fib(46). Here's a cut-n-paste of output:

Fib [44] = 701408733
Fib [45] = 1134903170
Fib [46] = 124406183631190 3
Fib [47] = 124406297121507 3
Fib [48] = 248812480752697 6
Fib [49] = 373218777874204 9
Fib [50] = 622031258626902 5
CPU time used : 0 sec

Anytime it gains more than one digit in an iteration, something's
clearly wrong...

[snip]

Weird output.

http://groups.google.com/groups?selm....uni-berlin.de

* GNU gcc (Cygwin, Cygwin with STLport, Mingw, DJGPP : Optimization 0-3) and
* Digital Mars C++ compiler (No optimization, Space, Speed) .

All those executables generate the same (valid) output

---------
$ fib.exe all 50
[---omitted---]
Fib [40] = 102334155
Fib [41] = 165580141
Fib [42] = 267914296
Fib [43] = 433494437
Fib [44] = 701408733
Fib [45] = 1134903170
Fib [46] = 1836311903
Fib [47] = 2971215073
Fib [48] = 4807526976
Fib [49] = 7778742049
Fib [50] = 12586269025
CPU time used : 0 sec
---------
Unfortunaly I don't have Borland compiler. So, I am unable to analyze what is reason for that.
Regards,

--
=============== =============== =======
Alex Vinokur
mailto:al****@c onnect.to
http://mathforum.org/library/view/10978.html
news://news.gmane.org/gmane.comp.lang.c++.perfometer
=============== =============== =======


Jul 19 '05 #11
In article <bo************ *@ID-79865.news.uni-berlin.de>,
al****@bigfoot. com says...

[ ... ]
Weird output.
Yes, to put it mildly.
http://groups.google.com/groups?selm....uni-berlin.de

* GNU gcc (Cygwin, Cygwin with STLport, Mingw, DJGPP : Optimization 0-3) and
* Digital Mars C++ compiler (No optimization, Space, Speed) .

All those executables generate the same (valid) output


In case you care, so do VC++ and Comeau (Ver. 7.1 and 4.3 respectively).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 19 '05 #12

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

Similar topics

2
2335
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild Python from source, because it also requires a change to Grammar. 1. Edit Python-2.3/Grammar/Grammar and add an alternative to the "listmaker" production: -listmaker: test ( list_for | (',' test)* )
6
1495
by: r.e.s. | last post by:
Should one expect the following execution times to be so different? ... Module_A takes about 4 seconds to run: x = (stuff_1) (stuff_2) Module_B takes about 80 seconds to run: x = (stuff_1) def f(y):
3
2015
by: JR | last post by:
Take a look at TestStruct1 and TestStruct2. Clearly, the D2 part of the union is MUCH larger than the D1 portion. I would expect sizeof(TestStruct1)==sizeof(TestStruct2) but that is not the case using Microsoft Visual C++ 2003. Here is what I get sizeof(TestStruct1)==0x108 sizeof(TestStruct2)==0x104 Is this normal C++ compiler behavior, or a bug in the compiler?
233
8569
by: E. Robert Tisdale | last post by:
I have access to a wide variety of different platforms here at JPL and they all have pretty good C 99 compilers. Some people claim that they have not moved to the new standard because of the lack of C 99 compliant compilers. Is this just a lame excuse for back-sliding?
16
2696
by: Martin Roos | last post by:
hy ppl, i'm trying to create some multiplatformed software here and i'm very curious about the sizes of common variables on different machines. if you are running something different than a 32-bit x86 box under your desk, please check what this program outputs. //-- program starts -- #include <stdio.h> #define showsize(x,y) printf("Size of %s %d \n",x,sizeof(y));
9
2445
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers, strings for logging, and structures for data points. I want to use one function to read data from this block and one function to write data, for example: sram_read(OBJECT_IDENTIFIER) would return a pointer to the appriate object and
9
2702
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio and run it once you've made sure there is no harmful code. Currently we have several stored procedures which final result is a select with several joins that returns many
0
1516
by: rgettman | last post by:
Hello, I'm attempting to use Pro*C to create a nested table and send that data to a stored procedure as a parameter. However, I'm getting a Pro*C compiler error that I'll describe below. I'm using Oracle 10.2 on Unix. 1. First I created a nested table type in the database: CREATE TYPE varchar2_list AS TABLE OF VARCHAR2(15); 2. Then I created the input file for "ott", called "acttest.typ":
14
1839
by: shyam.lingegowda | last post by:
Hi all, If I have two c++ programs and I compile that using two different compilers on Unix. Is it possible for these two exe's to communicate with one another. Since the way the exe's are generated by two different compilers are different is it possible to communicate at all. Is there any alternative for the same. What about libraries compiled with two different compilers. If someone can give some feedback on the same it will be of...
0
9892
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10997
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10661
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
10718
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
10347
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9497
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
7067
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
5917
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3172
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.