[TYPO3-core] RFC: core speedup

Bernhard Kraft kraftb at kraftb.at
Mon Mar 27 16:31:04 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kasper Skårhøj wrote:
> I agree fully with ingmar:
> 
> We should not change this unless you can prove a significant  
> performance gain.

Hi !


Pherhaps you didn't take a look at the powtest.php testing-script (which I used
to confirm the change works and used to measure the speed)

There's this part inside:
- --------------------------------------
// Doing sanity test:
for ($x = 0; $x < 32; $x++)	{
	$p = $x%($maxpow+1);	// $p will be between 0-31
	$r1 = pow(2, $p);
	$r2 = (1<<$p);
	if ($r1!=$r2)	{
		echo 'FATAL ERROR ! This should never happen pow(2, n)!=(2<<n) !'.chr(10);
		exit();
	}
}
- --------------------------------------


And I also don't see why there should be any objections ? There won't be any hidden bugs.

You apply the patch - Test if permissions work like before.



I'm not with your opinion not to change parts of the code if they actually work ...
We change code all the time - and not only for fixing bugs but also for introducing new features.
And this isn't even a feature but only a little change which brings back a little cpu resources :)

But I won't care anymore about this - my main objection was that generating bit-masks get's done
the "proper" way via bit-shifting and not using the mathematical pow() function. If others don't
think this is fine let it be as it is.


Dmitry: Dont worry - We are talking about a few microseconds here ... I assume ... as I wrote I
intended this code not only as speed-up but also as "correction" of the actual code ...



greets,
Bernhard
- --
- ----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
- ----------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEJ/coIl4dkVkDMFkRAtM4AKCKOaykYN/6YrxdbWoD06xx+ZUdkQCeM3i/
6KbVirCloVXs4RjB4mPchK0=
=psGP
-----END PGP SIGNATURE-----



More information about the TYPO3-team-core mailing list