Yasuo Ohgaki wrote:
We cannot assume word aligned data for strings. This is the reason why
there is
additional byte by byte comparison. It could be made to align memory to
word size,
but it requires memory allocation for comparison. I'm not sure which is
better, though.
Since PHP is controlling the memory management, there is no reason it can't properly align data elements ... based on the target platform. When you only had 640k of memory every byte counted, but these days the speed gain provided by simply wasting a few bytes and always padding buffers to a relevant word boundary is far greater than the space saving. Things have changed somewhat since the original C compilers were written. But this is better discussed on the 32/64bit optimization thread. Suffice to say that Firebird recorded substantial speed improvement once the basic ground rules were accepted and unnecessary 'byte related' processing dropped.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk