Boost logo

Boost :

From: Hailin Jin (hljin_at_[hidden])
Date: 2006-10-18 17:11:50

Hi Ulli -- good question.

Under GCC, all the four versions (read/write, proxy/accessor) run at the
same speed (fastest). However, under Visual Studio, interleaved=>planar
is faster than planar=>interleaved with your original code
(interleaved=>planar runs at the same speed as the ones under GCC). But
after I added a method for RGBValue as follows:
    template <typename T2>
    RGBValue& operator=(const T2& pa) {
        r=pa.r; g=pa.g; b=pa.b;
        return *this;
the proxy version for interleaved=>planar runs as fast as all others.
The only one left slower is the accessor version for
planar=>interleaved. My guess is that in the accessor version, the
compiler may create an unnecessary temporary object after dereferencing
the planar proxy. This could be something interesting for you to look into.


Ullrich Koethe wrote:
> HI Hailin,
> > we just tried your test file with GCC 4.0.2, GCC 4.1.1 and
>> Visual Studio 2005 (VC8). I used Cygwin for both GCC tests. My machine
>> is Xeon 3.2 dual CPU. Both proxy and accessor implementation run at the
>> SAME speed (release builds: -O2 for GCC and /O2 for Visual Studio). So
>> could it be that GCC 3 is not doing a good in optimizing the code?
> Apparently. So this is a non-issue then. Interestingly, the transformation
> interleaved => planar is faster than planar => interleaved. Is this also
> true on your platforms?
> Ulli

Boost list run by bdawes at, gregod at, cpdaniel at, john at