Re: Code generation [was: suggestion: slight optimization for UT_String]


Subject: Re: Code generation [was: suggestion: slight optimization for UT_String]
From: Randy Kramer (rhkramer@fast.net)
Date: Mon Mar 19 2001 - 13:44:21 CST


Mike,

Interesting! Thanks!

Randy Kramer

Mike Nordell wrote:
> Both. It does affect semantics of the expression. For the expression
> x = x * y
>
> the non-optimizing compiler generates something like
> tmp = x.operator*(y);
> x = tmp;
>
> while
> x *= y
> becomes
> x.operator*=(y);
>
> For POD (Plain Old Data) types any reasonable optimizer generates the same
> code, but for an unoptimized build or when using non-trivial objects it can
> make quite a difference.
>
> /Mike



This archive was generated by hypermail 2b25 : Mon Mar 19 2001 - 13:45:06 CST