Skip to content
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

[HttpKernel] allow cache warmers to add to the list of preloaded classes and files #36209

Merged
merged 1 commit into from Apr 5, 2020

Conversation

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Mar 25, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? yes
Tickets -
License MIT
Doc PR -

This PR makes cache warmers responsible for returning a list of classes or files to preload. It does so by adding the following to WarmableInterface::warmUp():
@return string[] A list of classes or files to preload on PHP 7.4+

Of course, this return value is properly implemented so that we can see what this provides in practice. Here are the benchmarks on a simple Hello World rendered with Twig:

  • without preloading: 360 req/s
  • with preloading in master: 560 req/s (+55%)
  • with preloading and this PR: 630 req/s (+75%)
@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:bundle-warmup-preload branch 2 times, most recently from ea52a40 to b896527 Mar 25, 2020
@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:bundle-warmup-preload branch from b896527 to 061ff32 Mar 26, 2020
@nicolas-grekas nicolas-grekas dismissed stof’s stale review Mar 26, 2020

review addressed

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:bundle-warmup-preload branch 4 times, most recently from dded411 to 1735544 Mar 26, 2020
@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:bundle-warmup-preload branch from 1735544 to 8ab75d9 Apr 4, 2020
@fabpot
fabpot approved these changes Apr 5, 2020
@fabpot

This comment has been minimized.

Copy link
Member

fabpot commented Apr 5, 2020

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 8a2a69f into symfony:master Apr 5, 2020
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.