Boost logo

Boost Users :

From: Hughes, James (jhughes_at_[hidden])
Date: 2007-06-29 05:19:14


> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Zeljko Vrba
> Sent: 29 June 2007 08:40
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [Test] Testing generated code.
>
> On Fri, Jun 29, 2007 at 02:05:59AM -0500, Michael Marcin wrote:
> >
> > There is a senior engineer that I work with who believes
> templates are
> > slow and prefers to write C or assembly routines. The templates are
> > slow
> >
>

There is some interesting evidence (don't have web address) that shows
that templates are actually considerably faster than some of the
standard C library functions (i.e. qsort vs std:: sort functions). This
is because templates are optimised to the actual type when in many cases
the standard C functions (although written in assembler) have to have
extra code (and therefore are slower) to handle more generic types.
Obviously, the exact differences will depend on the type of code being
used.

Try google searches on this - I was surprised at the difference -
perhaps your senior engineer will be also!!

James

This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net