Re: [PATCH 1/4] Tile caching performance patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

first of all thanks a lot for providing these patches. I definitely want
to get them merged as soon as possible. But there are a few minor issues
that should be discussed first. So let me start by commenting on your
first patch:

On Tue, 2009-06-02 at 04:11 -0400, Christopher Montgomery wrote:
>  #define TILE_DATA_POINTER(tile,x,y) \
>    ((tile)->data + \
> -   (((y) % TILE_HEIGHT) * (tile)->ewidth + ((x) % TILE_WIDTH)) *
> (tile)->bpp)
> -
> +   (((y) & (TILE_HEIGHT-1)) * (tile)->ewidth + ((x) &
> (TILE_WIDTH-1))) * (tile)->bpp)

As far as I know pretty much any compiler out there should be able to
replace a modulo by a power-of-2 constant by the bit-wise AND operation
without us explicitly doing so (see also
http://en.wikipedia.org/wiki/Modulo_operation#Performance_issues). So
for the benefit of readable code I suggest that we keep the code as it
is.


Sven


_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux