You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a restful interface, and jmsserializer is widely used. Most of operations for any rest backend are read-only-operations, and most of time is taking doctrine and query to the db. I imagine that this a flow on the rest point:
request -> controller -> doctrine -> fetch the data from the db (not sure about internals, but probably in array format) -> convert the array to object -> object is passing to the jmsserializer -> serializer converts it to json (hope there is no another conversion to the array internally)
I'm seeing some unnecessary steps in converting the array of data to the object, because I actually dont need this object, Im using it only for jmsserializer to work properly with my annotations on the object's fields.
As we know hydration process of objects in doctrine takes some extra resources, so my question is: can we prevent this step? For example, if we pass an array to the jmsserializer, and classname, it reads all annotations from the given class, but apply operations on the array, not an object (field names and array keys are identical). If there is no such feature yet, maybe someone can implement it?
The text was updated successfully, but these errors were encountered:
There is certainly room for optimization, but the question imo is whether this is worth it? How much time do we gain?
So far, this does not seem to have been a problem, and it might be more worthwhile to add a caching layer around the final result (the JSON response) than to optimize (and complexify) the process to get there.
We have a restful interface, and jmsserializer is widely used. Most of operations for any rest backend are read-only-operations, and most of time is taking doctrine and query to the db. I imagine that this a flow on the rest point:
request -> controller -> doctrine -> fetch the data from the db (not sure about internals, but probably in array format) -> convert the array to object -> object is passing to the jmsserializer -> serializer converts it to json (hope there is no another conversion to the array internally)
I'm seeing some unnecessary steps in converting the array of data to the object, because I actually dont need this object, Im using it only for jmsserializer to work properly with my annotations on the object's fields.
As we know hydration process of objects in doctrine takes some extra resources, so my question is: can we prevent this step? For example, if we pass an array to the jmsserializer, and classname, it reads all annotations from the given class, but apply operations on the array, not an object (field names and array keys are identical). If there is no such feature yet, maybe someone can implement it?
The text was updated successfully, but these errors were encountered: