undeflabs / UASECO-Maniaplanet

UASECO is a fork of the XAseco2/1.03 controller for Trackmania and has been overhauled to support the Modescript Gamemodes of Trackmania² in Maniaplanet and changes to run with PHP/7.x or newer. Only Modescript Gamemodes of Trackmania² are supported, there is no support included for the legacy Gamemodes of Trackmania².
https://www.uaseco.org/
25 stars 19 forks source link

Replace some assignment operators with idential operators #32

Closed C-Lodder closed 6 years ago

C-Lodder commented 6 years ago

Performance improvements with operators.

I can continue working on the rest of the files if you wish

Equality Operator (==): xi8w7

Identialcal Operator (===): gs1eh

undeflabs commented 6 years ago

I would do not change files which are developed by others, like the files in

includes/core/XmlRpc/* includes/core/gbxdatafetcher.class.php includes/core/mxinfofetcher.class.php includes/dedimania/* includes/maniaexchange/* includes/musicserver/*

Anyway I think that those changes doesn't change the performance much, do you have some benchmarks about this topic?

C-Lodder commented 6 years ago

I don't have any benchmarks, but it's a known small performance boost because when matching values, it doesn't do typecasting. Check the screenshots above to see the differences of the checks.

https://stackoverflow.com/questions/2401478/why-is-faster-than-in-php

I can revert the vendor files if need be, but are they ever updated anymore?

undeflabs commented 6 years ago

I read https://stackoverflow.com/questions/2401478/why-is-faster-than-in-php and I do believe it is good for performance, but I think that the improvement is not that great for the amount of work. But if you want to do it, keep going.

All of these files are still updated from time to time: includes/core/XmlRpc/* includes/core/gbxdatafetcher.class.php includes/core/mxinfofetcher.class.php includes/maniaexchange/* includes/musicserver/* So it would be better to revert the changes and keep them untouched.

The whole dedimania related files should be rewritten anyway (sometime later).

C-Lodder commented 6 years ago

Sure, I'll revert the vendor files and continue working on the rest of the controller tomorrow.

C-Lodder commented 6 years ago

@undeflabs files reverted