Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Micro optim using explicit root namespaces #24866

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2017

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Nov 7, 2017

Q A
Branch? 3.4
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Just doing that makes my local hello world as fast on 3.3 as on 4.0.
Spotted using Blackfire to identify the hot path.
Confirmed using both ab and blackfire curl on a local php -S.

It's not the first time these root namespaces make a measurable difference (on a selected list of functions only, see PHP-CS-Fixer/PHP-CS-Fixer#3048.)

PHP-CS-Fixer/PHP-CS-Fixer#3222 might become a more generic fix for this kind of optims.

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Nov 7, 2017
@SpacePossum
Copy link
Contributor

SpacePossum commented Nov 7, 2017

lets do them all in one go;
#24344 (using PHP-CS-Fixer/PHP-CS-Fixer#3223)

^_^

@nicolas-grekas nicolas-grekas merged commit e78d1c4 into symfony:3.4 Nov 8, 2017
nicolas-grekas added a commit that referenced this pull request Nov 8, 2017
This PR was merged into the 3.4 branch.

Discussion
----------

Micro optim using explicit root namespaces

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Just doing that makes my local hello world as fast on 3.3 as on 4.0.
Spotted using Blackfire to identify the hot path.
Confirmed using both `ab` and `blackfire curl` on a local `php -S`.

It's not the first time these root namespaces make a measurable difference (on a selected list of functions only, see PHP-CS-Fixer/PHP-CS-Fixer#3048.)

PHP-CS-Fixer/PHP-CS-Fixer#3222 might become a more generic fix for this kind of optims.

Commits
-------

e78d1c4 Micro optim using explicit root namespaces
@nicolas-grekas nicolas-grekas deleted the lazy-load branch November 9, 2017 15:06
@bradjones1
Copy link
Contributor

Follow-up proposal on Drupal core: https://www.drupal.org/project/drupal/issues/2960522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants