Please refer to the document :
"http://citeseer.ist.psu.edu/striegnitz00expression.html"
----snip-------
We measured the time to add four instances of Vec3 by
using these methods:
loop: we manually coded a loop that iterates through
the vector components and performs the
addition, expression templates: we simply wrote
e = a + b + c + d, were a - e are all of type Vec3
and let PETE do necessary optimizations,
lambda function: we used lambda(w,x,y,z, w + x + y +
z)(a,b,c,d).
All those expression were evaluated fifty million
times
on a SunUltra 10 with a 333MHz
UltraSparcIIi processor. We used Kuck and
Associatesâ
KCC version 4.0 with either SUNâs C 5.0
or Gnuâs C 2.95.2 as possible backend C compiler.
Furthermore, we investigated GNUâs C++ compiler
2.95.2.
loop:5.59 secs
expr template: 18.37 secs
lambda expression: 36.44 sec
------snip------
regards
divyank
--- Sohail Somani
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of divyank shukla Sent: Monday, July 31, 2006 8:06 AM To: boost-users@lists.boost.org Subject: [Boost-users] performance of template expression
snip....
My question is does the performance penalty still exist with g++(4.1) compilers as against boost::lambda functions.
Where are your performance results (hard numbers)? Have you measured them as compared to the rest of your algorithm? For example, if you do the general QR decomposition, chances are that's going to be the slow part.
One should usually profile after coding, rather than optimizing prematurely. Generally it's the algorithm that is slow. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com