From e531e7ce2e50cb1c70d399a41acaed0bcf5423f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Mon, 5 Nov 2001 21:18:48 +0000 Subject: [PATCH] added a comment about performance penalties with some compilers [SVN r11603] --- doc/tuple_users_guide.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/tuple_users_guide.html b/doc/tuple_users_guide.html index 21d396a..992b77a 100644 --- a/doc/tuple_users_guide.html +++ b/doc/tuple_users_guide.html @@ -416,8 +416,9 @@ parseable.

Performance

-Tuples are efficient. All functions are small inlined one-liners and a decent compiler will eliminate any extra cost. -Particularly, there is no performance difference between this code: +All tuple access and construction functions are small inlined one-liners. +Therefore, a decent compiler can eliminate any extra cost of using tuples compared to using hand written tuple like classes. +Particularly, with a decent compiler there is no performance difference between this code:
class hand_made_tuple { 
   A a; B b; C c;
@@ -439,6 +440,8 @@ and this code:
 t.get<0>(); t.get<1>(); t.get<2>(); 
 
+

Note, that there are widely used compilers (e.g. bcc 5.5.1) which fail to optimize this kind of tuple usage. +

Depending on the optimizing ability of the compiler, the tier mechanism may have a small performance penalty compared to using non-const reference parameters as a mechanism for returning multiple values from a function.