Difference is obvious......since g++ uses a different set of libraries.

-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
   ___    ___    __    _
  /  __/  /  __/  /     | / /
_\   \   _ \   \   /   /| |/ /
\___/ \___/   /_/ |__/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.opensolaris.org/pipermail/ug-bosug/attachments/20060410/8ee780ba/attachment.html>

Reply via email to