You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 in Serializer.