Re: QuickBinary extension for PHP

From: Date: Wed, 26 Feb 2014 18:38:10 +0000
Subject: Re: QuickBinary extension for PHP
References: 1 2 3  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-11574@lists.php.net to get a copy of this message
On Wed, Feb 26, 2014 at 6:52 PM, Chung Leong <cleong728@gmail.com> 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

« previous php.pecl.dev (#11574) next »