Skip to content

[Serializer] AbstractObjectNormalizer improve performance #28277

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

Merged
merged 1 commit into from
Aug 27, 2018

Conversation

martiis
Copy link
Contributor

@martiis martiis commented Aug 26, 2018

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #28276
License MIT

Check ticket for description

}
}
}

return null;
return $this->typesCache[$key] = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

isset($this->typesCache[$key]) will be false anyway if the value is null.

Copy link
Contributor Author

@martiis martiis Aug 26, 2018

Choose a reason for hiding this comment

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

You're right. Now marked as false and added extra check at the start to avoid using array_key_exists()

@martiis martiis force-pushed the object-normalizer-perf-opt branch 2 times, most recently from aca08e4 to 626d93d Compare August 26, 2018 16:44
@martiis martiis force-pushed the object-normalizer-perf-opt branch from 626d93d to 4224145 Compare August 26, 2018 16:46
@nicolas-grekas nicolas-grekas added this to the next milestone Aug 27, 2018
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fabpot
Copy link
Member

fabpot commented Aug 27, 2018

Thank you @martiis.

@fabpot fabpot merged commit 4224145 into symfony:master Aug 27, 2018
fabpot added a commit that referenced this pull request Aug 27, 2018
…nce (martiis)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] AbstractObjectNormalizer improve performance

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28276
| License       | MIT

Check ticket for description

Commits
-------

4224145 [Serializer] AbstractObjectNormalizer improve perf when checking types
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
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.

5 participants