Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer] add a local cache to CacheClassMetadataFactory#28457
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bendavies commentedSep 13, 2018
Can anyone see why 5.5 fails? |
ostrolucky commentedSep 13, 2018
Seems bad idea to decorate psr caches with local caches. Memory leaks, lost control over caches in user space. |
dunglas commentedSep 13, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not sure it is worth it to test that the local cache is actually used. Such tests are very hard to maintain. |
bendavies commentedSep 13, 2018 via email
Yeah, I thought the same. …On Thu, 13 Sep 2018, 14:21 Kévin Dunglas, ***@***.***> wrote: I'm not sure it is worth it to test that the local is actually used. Such tests are very hard to maintain. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#28457 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAmK8D4rBfgmSGsKgvzi6aVMrEU9VjUeks5ualvmgaJpZM4WmxXX> . |
bendavies commentedSep 13, 2018
reverted test change |
goetas commentedSep 14, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Can this implement the kernel |
nicolas-grekas commentedSep 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hello, thanks for the PR. I'm not sure this is the right fix. Here is why: I checked outegeloen/ivory-serializer-benchmark#11 and did a straight composer install: the perf number was not that different from others for SymfonyObjectNormalizerBenchmark. Here is a comparison profile before/after As you can see, the number of calls to THEN, once this is resolved, I noticed that IF ArrayAdapter is suited (ie sharing the same instance is fine), then we could/should chain an ArrayAdapter on top instead of inlining this logic here. To be confirmed by numbers. PS:
not needed as class info is static, and the number of files is finite, so this wouldn't qualify as a memory leak to me. |
bendavies commentedSep 17, 2018
Hey@nicolas-grekas thanks for the detailed review! I'll take another look later! |
bendavies commentedSep 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
head of 3.4 or 4.x? |
nicolas-grekas commentedSep 17, 2018
Master |
bendavies commentedSep 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
duh thanks. have reproduced that performance decrease between 3.4 and master. |
goetas commentedSep 23, 2018
So which commit caused the speed slowdown? |
bendavies commentedSep 23, 2018 via email
Haven't looked yet as I've been on vacation! …On Sun, 23 Sep 2018, 18:03 Asmir Mustafic, ***@***.***> wrote: So which commit caused the speed slowdown? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#28457 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAmK8NhxaWQIafa-Ke_HHGx4NVU68tRpks5ud77agaJpZM4WmxXX> . |
fabpot commentedOct 10, 2018
@bendavies What's the status of this PR? |
bendavies commentedOct 10, 2018
@fabian performance decrease in symfony 4 needs investigating. i haven't had time yet, but plan to. |
fabpot commentedOct 10, 2018
ok, thanks for the heads-up. |
nicolas-grekas commentedOct 10, 2018
bendavies commentedOct 10, 2018
i'm taking a look |
bendavies commentedOct 10, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
https://blackfire.io/profiles/compare/890441d8-bfb6-430b-a56f-a96fe137cd9f/graph So the local cache in this PR fixes the issue, reducing the cache lookups. Optimally, we could:
|
dunglas commentedOct 10, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php#L114 looks faulty too. This method is called for every attributes, but could be called only one time per object. WDYT@sroze. |
bendavies commentedOct 10, 2018
@dunglas good spot |
bendavies commentedOct 10, 2018
@nicolas-grekas@dunglas feedback on my last comment? |
nicolas-grekas commentedOct 10, 2018
I'd be happy to have a new bench once the patch is applied to see if the perf issue remains after :) |
fbourigault commentedOct 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I did some profiling. All where run using the following command: First I did a profile to see which of arrayAdapter or apcuAdapter is the best: Symfony 3.4 vs this PR: master vs this PR rebased: IMHO, we should work on reducing the EDIT : I forgot to disable serialization in arrayAdapter for my first comparison. Here are the new results: I forgot to disable serialization in the arrayAdapter. Here are the new comparison :https://blackfire.io/profiles/compare/d6b3637a-5c0b-4bdb-bcc2-db8a0b77667a/graph. EDIT2 : I opened a PR based on those results:#28889 |
bendavies commentedOct 16, 2018
as an aside, |
nicolas-grekas commentedOct 20, 2018
I closed by mistake, but was going to ask if#28889 does solve this now? |
bendavies commentedNov 14, 2018
indeed#28889 fixes the root cause. |
Uh oh!
There was an error while loading.Please reload this page.
ping@dunglas
This PR improves the performance of the Serializer in certain benchmarks,
https://www.goetas.com/blog/whats-new-in-jmsserializer-v20/ (https://github.com/goetas/ivory-serializer-benchmark) to be specific.
FYI,egeloen/ivory-serializer-benchmark#11 was also applied to obtain the results below.
Before PR:
After PR:
The improvement of the Symfony Object and GetSet normalizer benchmarks is significant.
Testing the change was a bit annoying, as you can see. Any better ideas?