From: Vladimir Prus (ghost_at_[hidden])
Date: 2001-10-25 01:45:41


I've tried to compile the following program (includes omitted):
int main()
{
        pair<int, int> p(3, 3);
        tuple<int, int> t(4, 4);
        cout << sizeof(t) << "\n";
}
With bcc 5.5.1, tuple construction was compiled into 40 assembly
instructions, or 186 bytes. This effect is also present when returning tuples
from functions. gcc performance differs : about 2 instruction (maybe 3) with
gcc 2.95.4, 11 with gcc 3.0.2. I think that these facts at least should be
documented -- there surely *is* performance penalty for using tuples under
some compilers. I also wonder if anything can be done to reduce code bloat
with borland?

Regards,
Vladimir