Turns out that Middleman loads every extension twice -- once with app.mode === :config, and another with app.mode === :server. This makes the current extension release do everything twice, inflating startup time by 2x.
Coverage decreased (-0.5%) to 43.478% when pulling 71dfaad07c3f72a9dbf7bde435718b48ad5d0bdc on schonfeld:dont-init-twice into c7e3703bc0fa09be81ef8df2cc6c80a65748e60c on datocms:master.
Turns out that Middleman loads every extension twice -- once with
app.mode === :config
, and another withapp.mode === :server
. This makes the current extension release do everything twice, inflating startup time by 2x.For reference, see: 1) https://github.com/middleman/middleman/issues/1952#issuecomment-348105969 2) https://github.com/middleman/middleman/blob/3d288197f8310e94e7e785b6dbb96d36b445812b/middleman-core/lib/middleman-core/extensions/external_pipeline.rb#L13