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
When profiling our isomorphic React app, one thing that we noticed was that srcSet generation was taking up a whole lot of CPU time - somewhere between a third and a half of the total cpu render time on a page that had 17 images.
We were able to work around the problem by disabling srcset generation on the backend, especially because the images that were being sent from the backend were LQIPs, and it didn't make sense to have a full srcset for those, but the amount of CPU time consumed by generating srcSets was surprising to me.
Has this already been optimized, and it's just an inherently expensive operation? Or are there gains to be made in optimizing the srcSet generation code?
The text was updated successfully, but these errors were encountered:
Hi @tstirrat15 thanks for bringing this up. As far as I know, srcset generation has not been exhaustively optimized so perhaps there are gains to be made there. I won't be able to dedicate time to look into this just yet, but would happily review a PR or discuss anything you come across if you have the time and want to look into it.
There have been numerous performance changes made to URL building (all credit goes to @baldurh) since this issue was first opened. I would invite you, or anyone else who's curious, to test these out in the latest release. I'm going to go ahead and close this issue now, but feel free to comment back with any questions you may have.
When profiling our isomorphic React app, one thing that we noticed was that srcSet generation was taking up a whole lot of CPU time - somewhere between a third and a half of the total cpu render time on a page that had 17 images.
Here's a
node-clinic
flamegraph showing the problem.We were able to work around the problem by disabling srcset generation on the backend, especially because the images that were being sent from the backend were LQIPs, and it didn't make sense to have a full srcset for those, but the amount of CPU time consumed by generating srcSets was surprising to me.
Has this already been optimized, and it's just an inherently expensive operation? Or are there gains to be made in optimizing the srcSet generation code?
The text was updated successfully, but these errors were encountered: