mercredi 4 décembre 2019

Are there benefits in resizing image inside web worker and returning smaller version to main thread? (performance wise)

I'm trying to figure out if following optimisation could lead to better performing web app that has substantial amount of images that tare being animated

Idea is as follows

  1. Pass large image url to web worker (i.e. 3000x3000px)
  2. Fetch and resize this image to something like 500x500px and return it's base64 string back to main thread

Will this help in making things like animations on the images smoother as browser is now dealing with fewer pixels? Obviously load times are unaffected, but I'm curious how much better performance can be.

In theory main thread never needs to load / decode larger image.




Aucun commentaire:

Enregistrer un commentaire