Sam 4810a841a0 PERF: reduce workload when optimizing images
Previously, we would initialize an ImageOptim object each time we resize.

This object init is mega expensive (170ms on a VERY fast machine):

```
[1] pry(main)> Benchmark.measure { FileHelper.image_optim   }
=> #<Benchmark::Tms:0x00007f55440c1de0
 @cstime=0.055742,
 @cutime=0.141031,
 @label="",
 @real=0.17165619300794788,
 @stime=0.0002750000000000252,
 @total=0.19890400000000008,
 @utime=0.0018560000000000798>

```

This happens cause during init it hunts for all the right binaries and sets
up internals.

We now memoize this object to avoid a huge amount of pointless work.
2019-01-09 12:50:11 +11:00
..
2017-07-28 10:20:09 +09:00
2018-06-07 13:28:18 +08:00
2018-09-10 19:39:09 -04:00
2017-07-28 10:20:09 +09:00
2018-06-07 13:28:18 +08:00
2018-09-10 19:39:09 -04:00
2017-07-28 10:20:09 +09:00
2016-07-15 11:36:06 +08:00
2018-02-26 10:25:58 +11:00
2018-04-25 08:44:07 +10:00
2018-06-07 13:28:18 +08:00
2017-07-03 15:26:57 -04:00
2018-08-31 11:46:55 +10:00
2018-04-18 11:32:32 +05:30
2018-04-02 13:52:51 +08:00
2018-06-07 13:28:18 +08:00
2017-07-28 10:20:09 +09:00
2018-08-10 11:34:01 +10:00
2019-01-02 15:12:36 -05:00
2017-07-28 10:20:09 +09:00