-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] make normalizers expose their vary-by characteristics, and use it for accurate caching #24436
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
Labels
Comments
I'm willing to help on this @nicolas-grekas could you guide me a little bit ? So we have to:
|
@nicolas-grekas just wondering if you had any intention of working on this? otherwise i may try take a look with some others |
@bendavies I don't, please do, that'd be awesome :) |
1 task
nicolas-grekas
added a commit
that referenced
this issue
Apr 29, 2018
… (dunglas, nicolas-grekas) This PR was merged into the 4.1-dev branch. Discussion ---------- [Serializer] Cache the normalizer to use when possible | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #24436 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | todo Still a WIP: * [x] Support `supportsDenormalization` As this will dramatically improve the performance of the Serializer component, can we consider introducing this change in 4.1 @symfony/deciders? ping @bendavies Commits ------- 16f8a13 [Serializer] Generalize caching support a bit c1e850f [Serializer] Cache the normalizer to use when possible
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As discussed in #24206, we currently have a perf issue with serialization, related to the fact that our
supports*()
method are too dynamic and cannot be cached (supports can vary based on$context
and/or$data
, even if most normalizers vary only on "type($data)").We spotted that if we allow normalizers to expose their vary-by characteristics, we might overcome the issue: we could add an new interface with a
getProvidedTypes
method, that would return an array keyed by PHP-type/class (with a wildcard to match all types), valued by a bitfield of "vary" consts: DATA | CONTEXT | TYPE.This would tell the outside what the
supports*()
methods vary on, so that we could implement an accurate caching layer inSerializer
.The text was updated successfully, but these errors were encountered: