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
Hi everyone. I spent a lot of time trying to optimize a serialization but I'm really having a hard time trying to solve this. So I'm going to post here all the data I was able to get.
I'm serializing a list of 50 "Task" objects which are Doctrine ODM objects.
To each of these 50 objects, I have 2 "User" (Doctrine ODM, again) objects attached and one "Project". The request takes ~700ms with half (or even more) of the time spent into the JMS serializer bundle.
Here is the screenshot of the kachegrind report (via xdebug) of my http call :
I understand that there is a lot of ways to optimize the output itself but still, it looks like the JMS serializer is taking a lot of time here and I would love to get some feedback to help me optimize that.
I'm thinking of a way to cache the result returned by the "JMS\Serializer\GraphNavigator->accept <cycle 4>" function or the "JMS\Serializer\GenericSerializationVisitor->visitProperty <cycle 4>" because most of the time, their input/output should be the same.
Thanks for helping.
The text was updated successfully, but these errors were encountered:
Serializer is quite heavy for bigger graphs of objects, especially in combination with Doctrine, as the mapping and transformation of values is being done twice.
Hi everyone. I spent a lot of time trying to optimize a serialization but I'm really having a hard time trying to solve this. So I'm going to post here all the data I was able to get.
I'm serializing a list of 50 "Task" objects which are Doctrine ODM objects.
To each of these 50 objects, I have 2 "User" (Doctrine ODM, again) objects attached and one "Project". The request takes ~700ms with half (or even more) of the time spent into the JMS serializer bundle.
So here is the final json output (gist) https://gist.github.com/lasryaric/c91362b1715f0004d677
Here is the screenshot of the kachegrind report (via xdebug) of my http call :
I understand that there is a lot of ways to optimize the output itself but still, it looks like the JMS serializer is taking a lot of time here and I would love to get some feedback to help me optimize that.
I'm thinking of a way to cache the result returned by the "JMS\Serializer\GraphNavigator->accept <cycle 4>" function or the "JMS\Serializer\GenericSerializationVisitor->visitProperty <cycle 4>" because most of the time, their input/output should be the same.
Thanks for helping.
The text was updated successfully, but these errors were encountered: