Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imageoptim taking much longer with Middleman > 4.3 #60

Open
umerebryx opened this issue Nov 6, 2019 · 4 comments · May be fixed by #63
Open

Imageoptim taking much longer with Middleman > 4.3 #60

umerebryx opened this issue Nov 6, 2019 · 4 comments · May be fixed by #63

Comments

@umerebryx
Copy link

Normally my build used to take 3-4 mins to complete. After upgrading to middleman 4.3 and middleman-imageoptim (0.3.0) build process is now taking 45-50 mins.

imageoptim [skipped] build/blog/5-hidden-tricks-every-publitas-user-should-know-about/uploading-multiple-files-to-publitas-dca7d05e.jpg not updated
imageoptim [skipped] build/blog/we-ve-won-the-red-herring-top-100-europe-award/header-1ebbe384.jpg not updated
imageoptim [skipped] build/blog/5-hidden-tricks-every-publitas-user-should-know-about/keyboard-shortcuts-publitas-eecac1d3.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/z-gallerie-hotspot-icons-b7adf6c2.jpg not updated
imageoptim [skipped] build/blog/5-hidden-tricks-every-publitas-user-should-know-about/selecting-multiple-hotspots-40971a74.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/thumbnail-80292a88.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/stio-branding-example-5ed3b8e8.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/header-d78ed453.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/custom-domain-8574618d.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/pottery-barn-branding-example-cdf4b7d0.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/stio-hotspot-icons-244b1b71.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/gall-gall-branding-example-d1e39495.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/stio-hotspot-icons-link-52ebbe68.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/gall-gall-hotspot-icons-53b66729.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/z-gallerie-custom-domain-cdcaaf09.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/z-gallerie-branding-example-c19d6cda.jpg not updated
imageoptim [skipped] build/blog/how-to-unify-your-online-publications-with-your-brand/publitas-hotspot-modal-6d9c2a76.jpg not updated
imageoptim [skipped] build/blog/product-update-banner-embed-code/flipbook-banner-embed-code-cd49f2e4.jpg not updated
imageoptim [skipped] build/blog/product-update-banner-embed-code/flipbook-embed-code-7c92f7a0.jpg not updated

Even the skipped images are taking longer. Is there a way to ignore imageoptim during middleman build process? Or any suggestions how I can get this back to 3-4 mins.

Environment:

Middleman 4.3.5
middleman-imageoptim (0.3.0)
Ubuntu 16.04
Ruby 2.5.3
builder 1.7.3

@voodoo
Copy link

voodoo commented Dec 4, 2019

I'm experiencing this as well on a mac 10.13.6

middleman 4.3.5
middleman-imageoptim (0.3.0)
ruby 2.6.0

@jagthedrummer
Copy link
Contributor

I was just looking at this and it looks like something has changed about how the updated_images list is built in Middleman::Imageoptim::Optimizer.

With middleman 3.3.12 and middleman-imageoptim 0.2.1 that list is only images that have been created/updated during the current build and I don't see any [skipped] lines in the build output.

With middleman 4.x and middleman-imageoptim 0.3.0 that list contains every single image in the entire build directory, whether or not it was created/updated, and I see a [skipped] line in the build output for every image.

In the little bit of digging I've done so far I haven't spotted anything obvious in this gem that has changed.

@jagthedrummer
Copy link
Contributor

It has something to do with changes in the ManifestResource that is causing the manifest file to be overwritten in the first stage of the build, so then in the second stage we don't have any information about which files have been optimized, so we have to do them all again.

The digging continues...

@jagthedrummer
Copy link
Contributor

#63 takes one of my projects from being a 22 minute build down to 2 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants