Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PropertyInfo] Use a single cache item per method#30523

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@deviantintegral
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#29977
LicenseMIT
Doc PRnone

This PR changes how property metadata is cached, significantly reducing the number of calls made between PHP and the backend cache. Instead of storing one cache item per method and set of arguments, a single cache item is stored per method. This matches well with real-world use, where most properties in an object will need to be inspected.

It's not clear to me if performance improvements fall under "bug fix", though I will say that we would have had to rewrite our code to remove PropertyInfo without this change.

Note that the absolute numbers in the above PR are best case. In production environments where memcache is on a remote server, we were seeing multiple seconds consumed by memcache calls.

@dunglas
Copy link
Member

The patch looks good to me.
In production, be sure to use a local cache (static array, APC...) instead of memcache or any other remote server. As it's just a metadata cache that can be computed, there is no benefits using a remote system, only a performance penalty.

@dunglas
Copy link
Member

dunglas commentedMar 11, 2019
edited
Loading

However, it should target master, we don't consider performance fixes as bug fixes.

@deviantintegral
Copy link
ContributorAuthor

In production, be sure to use a local cache (static array, APC...) instead of memcache or any other remote server. As it's just a metadata cache that can be computed, there is no benefits using a remote system, only a performance penalty.

One case we found is that if a new webserver is added to a pool due to autoscaling, having memcache + APC is useful in reducing first-load times.

Thanks for the review. I will open a new PR so this is available in case anyone in the future wants to patch this in.

symfony-splitter pushed a commit to symfony/property-info that referenced this pull requestApr 3, 2019
…ntintegral)This PR was merged into the 4.3-dev branch.Discussion----------[PropertyInfo] Use a single cache item per method| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #29977| License       | MIT| Doc PR        | noneReplacessymfony/symfony#30523 with a rebase to master.This PR changes how property metadata is cached, significantly reducing the number of calls made between PHP and the backend cache. Instead of storing one cache item per method and set of arguments, a single cache item is stored per method. This matches well with real-world use, where most properties in an object will need to be inspected.Note that the absolute numbers in the above PR are best case. In production environments where memcache is on a remote server, we were seeing multiple seconds consumed by memcache calls.Commits-------2a4f8a11d4 [PropertyInfo] Use a single cache item per method
fabpot added a commit that referenced this pull requestApr 3, 2019
…ntintegral)This PR was merged into the 4.3-dev branch.Discussion----------[PropertyInfo] Use a single cache item per method| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#29977| License       | MIT| Doc PR        | noneReplaces#30523 with a rebase to master.This PR changes how property metadata is cached, significantly reducing the number of calls made between PHP and the backend cache. Instead of storing one cache item per method and set of arguments, a single cache item is stored per method. This matches well with real-world use, where most properties in an object will need to be inspected.Note that the absolute numbers in the above PR are best case. In production environments where memcache is on a remote server, we were seeing multiple seconds consumed by memcache calls.Commits-------2a4f8a1 [PropertyInfo] Use a single cache item per method
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@deviantintegral@dunglas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp