[ug-bosug] datails abt dos.h
Binu Jose Philip
binu.j.philip at sun.com
Fri Apr 7 11:01:06 PDT 2006
Ananth A <writetoananth at gmail.com> writes:
>> Yeah C++ compilation is always slower due to overheads. Have you tried
>> adding extern "C" for you hello world program to force C linkage and
>> disable the C++ poly-mangled-virtual-inherited-temporarily-constructed-
>> referential overheads ? I dunno whether this will help though. :-P
>
> not just compiling but execution speed ( as per wall clock) is also slower.
>
> most of the overheads were disabled using the cmd line options to g++...
As I understand it, the difference is what you link with unless
you are compiling c++ code. I have this snippet in x.c:
int
main()
{
int i;
i = 1;
return (0);
}
$ gcc -c x.c
$ g++ -o xCC -c x.c
$ gcc -o x_c x.c
$ g++ -o x_cc x.c
------- at ---- tmp> ls -l x*
-rw-r--r-- 1 ------- staff 46 Apr 7 23:04 x.c
-rw-r--r-- 1 ------- staff 630 Apr 7 23:06 x.o
-rw-r--r-- 1 ------- staff 630 Apr 7 23:06 xCC.o
-rwxr-xr-x 1 ------- staff 6004 Apr 7 23:04 x_c
-rwxr-xr-x 1 ------- staff 6108 Apr 7 23:05 x_cc
$ diff x.o xCC.o
$ diff x_c x_cc
Binary files x_c and x_cc differ
Needless to say startup is where the speed difference must be.
cheers
Binu
_______________________________________________
ug-bosug mailing list
List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
List-Owner: mailto:ug-bosug-owner at opensolaris.org
List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54
More information about the ug-discuss
mailing list