[TYPO3-core] RFC: core speedup

Ingmar Schlecht ingmar at typo3.org
Sat Mar 25 20:22:21 CET 2006


Hi Bernhard,

Bernhard Kraft wrote:
> Description:
> I noticed that at many places in the core a construct like:
> 
> $somewhat = pow(2, $bit);
> 
> is used to get a bit-mask where bit number $bit seen from the LSB (least
> significant bit) side is set.
> 
> This wastes rare CPU resource as in this case a real "raise to the power
> of" operation get's performed
> in the CPUs ALU.
> 
> Normally when you work with bitmasks and you have to do such a thing
> (and even when you do mathemtical
> stuff but know about this) you do this by "bit shifting" ... This is an
> operation which can get done
> much faster by the CPU as it only has to move the bitmask to the left or
> right.

Interesting, I didn't know that.

However, -1 for now because 4.0 is feature freezed and your patch
doesn't fix a bug.

You can try to get your patch into 4.1 after 4.0 is released, but even
then I'd give it only a +0 because none of the pached files are
performance relevant (mostly Backend) and checking permission bitmasks
is a critical thing to which I'd I'd say "Never change a running system".

cheers,
Ingmar



More information about the TYPO3-team-core mailing list