-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[performance] provide a simpler name converter than MetadataAwareNameConverter #35085
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
Comments
ping #34708 |
IIRC, with a compiler pass, you can use |
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calcul all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calcul all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculate all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
Hmm, cf #35252, there was a bug in the caching, so it will be less critical, but still useful ticket. |
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculate all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculate all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculate all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
…nic) This PR was merged into the 4.4 branch. Discussion ---------- [Serializer] Fix cache in MetadataAwareNameConverter | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | ref #35085 | License | MIT | Doc PR | `isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculation all the time. This is a serious perf improvement in prod mode for an api.   Commits ------- 6449f92 [Serializer] Fix cache in MetadataAwareNameConverter
Thank you for this issue. |
Hello? This issue is about to be closed if nobody replies. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculate all the time. This is a critical perf improvement in prod mode for an api. Ref symfony#35085
Description
I dug a lot it Symfony internals lastly and the name converter stack was very costly. I reduced it a lot with #35041... Then I realized than I don't need at all a name converter.
The default one is MetadataAwareNameConverter, that allow a fallbackNameConverter. But the fallback is called ONLY after having grab all the metadata, checked for a
SerializerName
. I never saw a project using this attribute, and it troubles me that it costs so much. So just giving a simpler NameConverter as fallback is not enough because the worse already happened.I tried another way: replacing MetadataAwareNameConverter completely. It seems to work flawlessly and gives me a 11% performance improvement (AFTER the previously mentioned patch, so more than a 25% gain from master)
Questions:
SerializerName
and you didn't provide a NameConverter fallback, switching to NullNameConverter"?The text was updated successfully, but these errors were encountered: