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

[Serializer] Add local cache to normalizers#24228

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

Merged
nicolas-grekas merged 1 commit intosymfony:3.4fromnicolas-grekas:ser-cache
Sep 20, 2017

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedSep 15, 2017
edited
Loading

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

Should help making the Serializer a bit faster.

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneSep 15, 2017
Copy link
Contributor

@ro0NLro0NL left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

+ inlineSerializer::denormalizeObject()?

publicfunctionsupportsNormalization($data,$format =null)
{
returnparent::supportsNormalization($data,$format) &&$this->supports(get_class($data));
returnparent::supportsNormalization($data,$format) &&(isset($this->cache[$type =\get_class($data)]) ?$this->cache[$type] :$this->cache[$type] =$this->supports($type));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

applies to supportsDenormalization as well, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

what aboutprivate static $cache +private static supports() + inline isGetMethod

nicolas-grekas reacted with thumbs down emoji
publicfunctionsupportsNormalization($data,$format =null)
{
returnparent::supportsNormalization($data,$format) &&$this->supports(get_class($data));
returnparent::supportsNormalization($data,$format) &&(isset($this->cache[$type =\get_class($data)]) ?$this->cache[$type] :$this->cache[$type] =$this->supports($type));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same

nicolas-grekas reacted with thumbs down emoji
@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedSep 16, 2017
edited
Loading

  • inline Serializer::denormalizeObject()

Done.
For other comments: static state won't provide anything is practice, and are not better in terms of design.

publicfunctionsupportsDenormalization($data,$type,$format =null/*, array $context = array()*/)
{
$context =func_num_args() >3 ?func_get_arg(3) :array();
$context =\func_num_args() >3 ?func_get_arg(3) :array();
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@nicolas-grekasnicolas-grekasforce-pushed theser-cache branch 2 times, most recently from0fdab2f to23f485eCompareSeptember 16, 2017 08:34
@nicolas-grekasnicolas-grekas changed the title[Seriaizer] Add local cache to normalizers[Serializer] Add local cache to normalizersSep 16, 2017
@ogizanagi
Copy link
Contributor

Won't it make sense to backport what could be on lower branches?

@nicolas-grekas
Copy link
MemberAuthor

Won't it make sense to backport what could be on lower branches?

AFAIK, we merge perf improvements as new feats usually (even if we diverged sometime from this rule, but we shouldn't anymore unless catastrophic. Not sure it's the case here?)

@nicolas-grekasnicolas-grekas merged commitb0c5cf0 intosymfony:3.4Sep 20, 2017
nicolas-grekas added a commit that referenced this pull requestSep 20, 2017
…kas)This PR was merged into the 3.4 branch.Discussion----------[Serializer] Add local cache to normalizers| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#24206| License       | MIT| Doc PR        | -Should help making the Serializer a bit faster.Commits-------b0c5cf0 [Serializer] Add local cache to normalizers
@nicolas-grekasnicolas-grekas deleted the ser-cache branchSeptember 20, 2017 14:33
nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull requestOct 1, 2017
…rs (nicolas-grekas)"This reverts commitaad62c4, reversingchanges made to779e8ed.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas approved these changes

+2 more reviewers

@ro0NLro0NLro0NL approved these changes

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@ogizanagi@dunglas@ro0NL

[8]ページ先頭

©2009-2025 Movatter.jp