On Wed, Feb 26, 2014 at 6:52 PM, Chung Leong <[email protected]> wrote:
> One thing I've been wondering is whether it's possible to quickly tell
> if a GD image is empty. QB code typically handles images as arrays of
> float32. Conversion from GD's internal format occurs when the function
> is called. Currently, QB will do all the calculations even when the
> image is empty, passed in to accept the result. The calculations
> themselves probably aren't that costly. Going through them does pretty
> much force everything else out the L1 and L2 caches. If there's a way
> to avoid taking that hit it would be nice.

It is hard to see that but to loop through the pixels.

It could be possible to optimize the conversion/test using 64bit sse
instructions, at least with the 31 bits format.

gd 2.2 will bring 32bit (a)rgb format as well as 8/32 integer
grayscale formats with continuous buffer (and not per row), that
should help a lot to optimize such operations, as the 1 bit left is
slightly annoying for optimizations :)

Cheers,
--
Pierre

@pierrejoye | http://www.libgd.org

-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to