Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[ObjectMapper] cache attributes in memory#61497
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
src/Symfony/Component/ObjectMapper/Metadata/ReflectionObjectMapperMetadataFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/ObjectMapper/Metadata/ReflectionObjectMapperMetadataFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
The table in the PR header does not match our standards |
I understood that as long as MIT was present this was ok, I removed the columns that are not relevant... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If the$reflectionClassCache keys are only strings, the SplObjectStorage is not needed right?
(because of$this->reflectionClassCache[$object::class] it will throw an exception)
src/Symfony/Component/ObjectMapper/Metadata/ReflectionObjectMapperMetadataFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks great!👍
GromNaN left a comment• 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
That's a good iterative improvement. To get the best performance, this cache should be generated in the DIC cache and injected at instantiation.
fabpot commentedAug 27, 2025 • 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.
As this is a perf improvement, it cannot be considered as a bug and as such, it will be merged in 7.4. |
Thank you@soyuka. |
Uh oh!
There was an error while loading.Please reload this page.
Profile:
phpbench
```phpnamespace Symfony\Component\ObjectMapper\Benchmarks;use PhpBench\Attributes as Bench;
use Symfony\Component\ObjectMapper\ObjectMapper;
use Symfony\Component\ObjectMapper\Tests\Fixtures\A;
use Symfony\Component\ObjectMapper\Tests\Fixtures\C;
use Symfony\Component\ObjectMapper\Tests\Fixtures\D;
#[Bench\BeforeMethods('setUp')]
class ObjectMapperBench
{
private ObjectMapper $objectMapper;
private A $sourceObject;
}