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

[FrameworkBundle] Fix perf issue in CacheClearCommand::warmup() #23086

Merged
merged 1 commit into from Jun 9, 2017

Conversation

nicolas-grekas
Copy link
Member

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

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

On slow file systems (eg on Windows), I noticed that writing files without doing any changes just kills perf.
Limiting the depth also helps when the symfony/cache component is used (because it can store thousands of files in its cache pool directory structure, and iterating there is also a waste of fs time).
I choose the max depth by looking at where existing apps put their files and added one level more just in case.

@Wirone
Copy link
Contributor

Wirone commented Jun 7, 2017

This PR is related to my specific case where upgrading to 3.3 in one of our apps makes it unusable in app_dev.php. I took Blackfire profile for bin/console cache:clear and it took 1m47s. After applying this patch it took 54s.

@nicolas-grekas can view those profiles.

@Wirone
Copy link
Contributor

Wirone commented Jun 7, 2017

Without additional depth limitations it took 1m8s.

@fabpot
Copy link
Member

fabpot commented Jun 9, 2017

Thank you @nicolas-grekas.

@fabpot fabpot merged commit b58f060 into symfony:2.7 Jun 9, 2017
fabpot added a commit that referenced this pull request Jun 9, 2017
…mup() (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix perf issue in CacheClearCommand::warmup()

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

On slow file systems (eg on Windows), I noticed that writing files without doing any changes just kills perf.
Limiting the depth also helps when the symfony/cache component is used (because it can store thousands of files in its cache pool directory structure, and iterating there is also a waste of *fs* time).
I choose the max depth by looking at where existing apps put their files and added one level more just in case.

Commits
-------

b58f060 [FrameworkBundle] Fix perf issue in CacheClearCommand::warmup()
@nicolas-grekas nicolas-grekas deleted the warmup-perf branch July 10, 2017 15:58
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.

None yet

4 participants