Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: perf regression with Symfony 6.3 #5721

Merged
dunglas merged 2 commits into
api-platform:3.1from
dunglas:fix/perf-regression
Aug 4, 2023
Merged

fix: perf regression with Symfony 6.3 #5721
dunglas merged 2 commits into
api-platform:3.1from
dunglas:fix/perf-regression

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented Aug 4, 2023

Q A
Branch? main
Tickets Closes n/a
License MIT
Doc PR n/a

The switch to the new NormalizerInterface::getSupportedTypes() system provided by Symfony in #5672 introduced a performance regression.

Symfony 6.2 + API Platform 3.1.12 (faster) VS Symfony 6.3 + API Platform 3.1.13

image

With this patch fixes the issue: Symfony 6.2 + API Platform 3.11.12 VS Symfony 6.3 + API Platform with this patch

image

@dunglas dunglas changed the base branch from main to 3.1 August 4, 2023 14:40
@dunglas dunglas changed the title Fix/perf regression fix: perf regression with Symfony 6.3 Aug 4, 2023
@dunglas
Copy link
Copy Markdown
Member Author

dunglas commented Aug 4, 2023

Actually, I'm not sure that we can enable the cache for these normalizers. Items must be object that aren't traversable. I don't think that Symfony currently allows doing that.

@dunglas
Copy link
Copy Markdown
Member Author

dunglas commented Aug 4, 2023

Answer to myself: we can because the cache is split per concrete type, so this PR is ready to be merged.

https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Serializer/Serializer.php#L265

@dunglas dunglas merged commit 4dcfc16 into api-platform:3.1 Aug 4, 2023
@Renrhaf
Copy link
Copy Markdown
Contributor

Renrhaf commented Aug 11, 2023

Thank you @dunglas 👍

Romaixn pushed a commit to Romaixn/core that referenced this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants