[TYPO3-core] RFC: core speedup

Bernhard Kraft kraftb at kraftb.at
Sat Mar 25 20:39:01 CET 2006


Ingmar Schlecht wrote:

> Interesting, I didn't know that.
> 
> However, -1 for now because 4.0 is feature freezed and your patch
> doesn't fix a bug.

Ok.


> 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)

Performane is always the negated sum of all slow code :)


> and checking permission bitmasks
> is a critical thing to which I'd I'd say "Never change a running system".

Here I rather think we (TYPO3) are the "exoctic" ones .... check for bitmask alegbra
in any appropriately programmed code (mysql, apache, gnome/kde-core, etc.) and you will
see that they all use << rather than pow ....

At least in school we learned to use << instead of pow() if we do 2^x operations. The later
one will even return a float in some cases (which of course is surely not wanted for bitmasks :)

 From php-doc:

  In PHP 4.0.6 and earlier pow() always returned a float, and did not issue warnings.

altough we do not allow PHP 4.0.6 anymore you see that pow() is rather for "real" mathematical "power of"
operations while doing bit-masking with << and >>



PS: Check the linux kernel for "<<" ... this is really a good source as bit shifting is often required
when doing hardware stuff ... you will find docens of "<<" usage but no view of "pow(" ...

greets,
Bernhard



More information about the TYPO3-team-core mailing list