[LiveComponent] Performance issue with `LiveComponentMetadataFactory::createLivePropMetadata`
While we were talking with @mtarld, we noticed the method LiveComponentMetadataFactory::createLivePropMetadata could be optimized.
For a given class name and property name, the result will always be the same, meaning we don't have to re-compute the LivePropMetadata|LegacyLivePropMetadata each time this method is called, especially by the LiveComponentHydrator.
The result could be put in static-cache or maybe in a filesystem cache (e.g.: if introducing a warmup system).
When playing with https://ux.symfony.com/demos/live-memory/, we can see the 7 calls to createLivePropMetadata each time we interact with the live component:
I didn't profile the code yet, but if your app has many users, it can definitely be interesting :)
EDIT: in my local env, that's between ~10ms and ~20ms for the LiveMemory:* and InvoiceCreator* live components.
That's not much, but relying on Reflection during the runtime is not super efficient. I will see to cache-warm the up!
Absolutely! The Hydrator needs to be split into separated responsabilities, if you're looking at related things after this one 😓
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?