Skip to content

Commit

Permalink
minor #36646 [HttpFoundation][HttpKernel] Add more preload always-nee…
Browse files Browse the repository at this point in the history
…ded symbols (fancyweb)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpFoundation][HttpKernel] Add more preload always-needed symbols

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Part of https://github.com/orgs/symfony/projects/1#card-37082675
| License       | MIT
| Doc PR        | -

`ConfigCache` is in the hot path because it is used for every request in the kernel boot (initializeContainer() method). I guess we can consider that every kernel is going to be booted so it should always be used.

`InputBag` should be added too - it is used in the Request initialization so it will likely be hit on every request as well - but maybe it wasn't added in the first place for a reason since other bags are already there?

Commits
-------

636a8bd [HttpFoundation][HttpKernel] Add more preload always-needed symbols
  • Loading branch information
nicolas-grekas committed Apr 30, 2020
2 parents a114f8d + 636a8bd commit 27c10f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -20,6 +20,7 @@ class_exists(AcceptHeader::class);
class_exists(FileBag::class);
class_exists(HeaderBag::class);
class_exists(HeaderUtils::class);
class_exists(InputBag::class);
class_exists(ParameterBag::class);
class_exists(ServerBag::class);

Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -39,6 +39,9 @@
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;

// Help opcache.preload discover always-needed symbols
class_exists(ConfigCache::class);

/**
* The Kernel is the heart of the Symfony system.
*
Expand Down

0 comments on commit 27c10f0

Please sign in to comment.