I noticed that the logging happens in bulk, at the end of a compression loop, instead of logging each file as it is being compressed. This is usually fine for text-based files, but for images it makes the build process look stuck for several minutes.
Related issues:
#181 - Build appears to hang (hung, froze, frozen, freeze) while images are being compressed.
#71 - Original discussion about beautifying terminal output - not sure if it contributed to this behavior.
I also noticed that the compression loop happens in memory, and the files are later written to disk in bulk at the end of compression loop. Not sure if this is by design, but I do sure hope it doesn't run out of memory.
IMPORTANT:
Both the terminal output delay and the bulk memory use might seem trivial, but they're important when it comes to CI/CD like GitHub Actions, Netlify or Vercel:
- The available working memory could be limited and may run out.
- The lack of output for a long time could trigger a kill signal and fail the build.
In fact, I tried running a Vercel build with the default config and it failed with a timeout:
Your build exceeded the 45 minute limit. Enable Enhanced Builds to increase machine size and reduce build times.
I think the Readme needs adequate notice to prefer excluding Image, or filter the source images inside _astro as indicated in #172.
I noticed that the logging happens in bulk, at the end of a compression loop, instead of logging each file as it is being compressed. This is usually fine for text-based files, but for images it makes the build process look stuck for several minutes.
Related issues:
#181 - Build appears to hang (hung, froze, frozen, freeze) while images are being compressed.
#71 - Original discussion about beautifying terminal output - not sure if it contributed to this behavior.
I also noticed that the compression loop happens in memory, and the files are later written to disk in bulk at the end of compression loop. Not sure if this is by design, but I do sure hope it doesn't run out of memory.
IMPORTANT:
Both the terminal output delay and the bulk memory use might seem trivial, but they're important when it comes to CI/CD like GitHub Actions, Netlify or Vercel:
In fact, I tried running a Vercel build with the default config and it failed with a timeout:
I think the Readme needs adequate notice to prefer excluding
Image, or filter the source images inside_astroas indicated in #172.