whatwg/html-build

Consider a "fast mode" for local iteration

Closed this issue · 3 comments

If you're just locally iterating, there are a few ways we could make the build faster.

We could introduce these all as individual command line switches, then bundle them together into a --fast, perhaps?

  • --no-update would be part of this
  • Don't do the linting step
  • Don't generate variants: Wattsi currently produces singlepage, multipage, dev edition, and commit snapshot variants. For local iteration you might only want one of these (probably singlepage). This is probably the biggest potential win.
  • Don't perform syntax highlighting. I'm not sure how much overhead this adds these days, but it might help.

A 5 to 10 second total build time (closer to 5 than 10, I’d say) is what I think we could expect in most environments from a --fast option that provided the set of speedup options proposed.

From testing in my environment (2.8 GHz Quad-Core Intel Core i7, 16GB RAM), details:

  • --no-update would be part of this

In my environment, using --no-update reduces the build time from ~30s down to ~27s (3s less).

  • Don't do the linting step

In my environment, that on its own reduces the build time from ~27s down to ~21s (6s less).

  • Don't generate variants: Wattsi currently produces singlepage, multipage, dev edition, and commit snapshot variants. For local iteration you might only want one of these (probably singlepage). This is probably the biggest potential win.

In my environment, that on its own reduces the build time from ~27s down to ~14.5s (12.5s less).

  • Don't perform syntax highlighting. I'm not sure how much overhead this adds these days, but it might help.

In my environment, that on its own reduces the build time from ~27s down to ~18s (9s less).

With all of the above changes applied, and with --no-update specified, the build time is ~5s.

So that ~5s build time would be a total reduction of:

  • ~22s less (for the “normal” case with --no-update specified)
  • ~25s less (for the “update everything too” case without --no-update specified)

I did the easier parts of these. @sideshowbarker would you be able to help add an option to Wattsi to govern which variants to generate?

I did the easier parts of these. @sideshowbarker would you be able to help add an option to Wattsi to govern which variants to generate?

Yup (may be able to get to it today)