|
Boost Users : |
Subject: Re: [Boost-users] [GIL] Performance warning...
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-11-28 14:10:12
I have done some testing and on my machine ( MSVC10 in x64 ). The new
code ( using const & ) is slightly faster than the old code ( using
value type ). Not by much, but at least it's not slower. See below for
my test.
I also think that since the default_channel_converter is using const&
the following channel_converter functions should do the same. Does
that makes sense in your eyes?
#include <iostream>
#include <boost\timer.hpp>
#include <boost\gil\gil_all.hpp>
using namespace std;
using namespace boost;
using namespace gil;
int _tmain(int argc, _TCHAR* argv[])
{
rgba8_image_t src( 10000, 10000 );
fill_pixels( view( src ), rgba8_pixel_t( 12,12,12,12 ));
rgba32_image_t dst( 10000, 10000 );
timer t;
for( size_t i = 0; i < 10; i++ )
copy_and_convert_pixels( view( src ), view( dst ) );
cout << t.elapsed() << " sec" << endl;
return 0;
}
Regards,
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