Boost logo

Boost Users :

Subject: Re: [Boost-users] [GIL] Performance warning...
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-11-27 18:25:30


Lubomir, looking at the default_channel_converter the channels already
arrive as a const reference. All I did was to make sure they are still
const references in the channel_converter functions. In all cases the
source channels should at least be const. Which allows for more
compiler optimizations.

I did run the performance test in gil_test suite and the changes were
marginal. Some tests were faster some were slower after the change.

Christian

On Fri, Nov 27, 2009 at 6:13 PM, Lubomir Bourdev <lbourdev_at_[hidden]> wrote:
> This was done on purpose. I don't know if it still holds, but it used to be
> that a const reference to a simple type like an int or char is slower than
> passing the type by value. This is the same reason most STL algorithms take
> iterators by value. If you want to make this change it is important to
> verify that performance of simple built-in channel types is not adversely
> affected.
>
> Lubomir
>
> On 11/27/09 12:17 PM, "Christian Henning" <chhenning_at_[hidden]> wrote:
>
>> Hi Eloi, you're correct and I'll fix that. I can even make it const
>> reference. Running the test shows no real difference but that might be
>> only because no expensive channels are being used.
>>
>> I'll commit the changes asap.
>>
>> Lubomir, please review the changes if your time allows. Affected files
>> are channel_algorithm.hpp and gil_concept.hpp.
>>
>> Thanks,
>> Christian
>>
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net