[ug-bosug] datails abt dos.h
Binu Jose Philip
binu.j.philip at sun.com
Mon Apr 10 00:01:52 PDT 2006
"Narendra Kumar.S.S" <ssnkumar at gmail.com> writes:
> Difference is obvious......since g++ uses a different set of libraries.
That is why used a test which used no "obvious libraries", only
the implicit crt1's and such.
Anyway, you are right. C++ is mostly a vastly powerful
pre-processor built over C with libraries to match. If you
don't use those features or those libraries, you will get
only the overhead and not the benefits.
Err.. no, I am not fighting a language war ;-)
cheers
Binu
> -Narendra
>
>
> On 4/7/06, Binu Jose Philip <[[binu.j.philip at sun.com]]> wrote:
>
> 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]]
>
>
>
> --
> Warm Regards,
> S.S.Narendra Kumar
> Visit my blogs at:
> [[http://ssnarendrakumar.blogspot.com/]]
> [[http://blogs.sun.com/roller/page/ssnkumar]]
> ___ ___ __ _
> / __/ / __/ / | / /
> _\ \ _ \ \ / /| |/ /
> \___/ \___/ /_/ |__/
> _______________________________________________
> 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
_______________________________________________
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