-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Serializer] CacheClassMetadataFactory performance #28272
Comments
A radical but efficient solution would be #22051 :) |
There's a regression identified in #28457 (comment). |
This will improve perf, but later I noticed that I haven't enabled opcache for cli, which improved performance (cant remember by how much atm, but near as dev env), because |
let's close then as the issue seems to be resolved |
Symfony version(s) affected: 4.1.3 (havent test other)
Description
IDK if it was discussed in the past but recently i was checking symfony serializer (ObjectNormalizer) performance, and in dev env it was faster than in prod. I have configured opcache just like in docs, xdebug disabled.
My test is serializing 1000 objects with various scalar value properies + one property is an object + one property holds 5-15 small objects in array.
Serialize took about
2184 ms
prod env,152 ms
dev env.How to reproduce
My actual test https://github.com/martiis/symfony-serialization-bench/blob/master/src/Command/BenchSymfonySerializerCommand.php#L78
Possible Solution
Found out that in prod CacheClassMetadataFactory does not keep loaded classes like ClassMetadataFactory and everytime it goes into file system checking cache. I thought opcache should fix this but it didint or maybe i missed something? if I put
$loadedClasses
property inCacheClassMetadataFactory
performance back as in dev env.Additional context
Opcache config
The text was updated successfully, but these errors were encountered: