SMF
SMF copied to clipboard
Apply native_function_invocation in PHPCS
Some built-in functions can be turned into specific opcodes at compile time when the compiler is sure that they will be used (i.e. no namespace fallback is needed). This can have a major performance impact when they appear in hot paths.
use function is_array;
I setup and ran a benchmark on this. Now granted its not using SMF code because I set it up in a repo I had at hand and really that's irrelevant. The sample size is small but even with the low number of revs and its a benefit can be seen.
Results can be found here: https://gist.github.com/Tyrsson/138566046b96576707afd719cd09ed81
- existing calls to built in classes are prefixed with the backslah, so this commit follows that pattern
- I didn't find an option to change this fixer's behavior, and there is no way that I'll do any of this by hand