Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Apply native_function_invocation in PHPCS #8218

Open
wants to merge 1 commit into
base: release-3.0
Choose a base branch
from

Conversation

live627
Copy link
Contributor

@live627 live627 commented May 11, 2024

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.

@live627 live627 added the Housekeeping SMF code reorganization label May 11, 2024
@live627 live627 force-pushed the compiler_optimized branch from 20277b3 to 8c9b68b Compare May 11, 2024 05:36
@tyrsson
Copy link
Collaborator

tyrsson commented May 11, 2024

use function is_array;

@tyrsson
Copy link
Collaborator

tyrsson commented May 16, 2024

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

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.
@live627 live627 force-pushed the compiler_optimized branch from 8c9b68b to c54551f Compare July 23, 2024 08:23
@live627
Copy link
Contributor Author

live627 commented Jul 23, 2024

  • 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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Housekeeping SMF code reorganization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants