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
While doing bulk operations with images that involved this library, I noticed a noticeable difference in the serialization time compared to the standard DRF library.
Here is a quick snippet that I am trying:
We have plenty of combinations of aspect ratios and containers, each of them has to be serialized from SimplePicture object to its url, which leads to a heavy CPU-bound operation.
However, I cannot yet come up with the solution to that problem.
Would you have any ideas on this?
Best,
Rust
The text was updated successfully, but these errors were encountered:
@amureki, as a see it, we currently render the ratios part of the payload twice if you declare a specific ratio. We first serialize everything and overwrite it later. Avoiding this could resolve in a considerable performance boost. Would you care to provide a patch?
amureki
added a commit
to amureki/django-pictures
that referenced
this issue
Jan 23, 2024
Greetings Johannes!
While doing bulk operations with images that involved this library, I noticed a noticeable difference in the serialization time compared to the standard DRF library.
Here is a quick snippet that I am trying:
The results on my dev machine (MacBook M1, 16 Gb) are the following:
I believe that the issue comes from the serialization of this part:
https://github.com/codingjoe/django-pictures/blob/main/pictures/contrib/rest_framework.py#L25-L38
We have plenty of combinations of aspect ratios and containers, each of them has to be serialized from
SimplePicture
object to its url, which leads to a heavy CPU-bound operation.However, I cannot yet come up with the solution to that problem.
Would you have any ideas on this?
Best,
Rust
The text was updated successfully, but these errors were encountered: