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
I was wandering why, despite #116 the initial image generation was pretty slow (18 seconds for 14 pictures). So I dug into the code and found, that for each size-format combination the following happens:
resize
this.getFullStats
this.getHash
this.getFileContents and hash calculation (takes about 50ms+ per run)
Would this have any downsides? For me it just meant, that an image generates in 50 ms instead of 800ms. My initial build time is down from 18 seconds to 1.5 seconds. 12x faster, not bad in my book 😄
The text was updated successfully, but these errors were encountered:
I was wandering why, despite #116 the initial image generation was pretty slow (18 seconds for 14 pictures). So I dug into the code and found, that for each size-format combination the following happens:
Some console log output:
As you can see, the repeated calling of hash bumps up the time per image to just under a second for just this image.
All of the getHash calls are done on the same Image instance. Hence, I propose this change:
Would this have any downsides? For me it just meant, that an image generates in 50 ms instead of 800ms. My initial build time is down from 18 seconds to 1.5 seconds. 12x faster, not bad in my book 😄
The text was updated successfully, but these errors were encountered: