Imageoptim and middleman build

I’m using imageoptim, the latest version, in my gemfile:

gem "middleman-imageoptim", :git => "https://github.com/plasticine/middleman-imageoptim", :branch => "master"

the problem is that when I run middleman build it compresses all images over and over again and it’s a slow process.

what would you recommend?