lasso-js / lasso

Advanced JavaScript module bundler, asset pipeline and optimizer
582 stars 75 forks source link

Caching `lasso-babel-transform` and `lasso-marko` yields 10x faster boot time for a lassoPage #299

Open mufumbo opened 5 years ago

mufumbo commented 5 years ago

Our project uses lasso to build an isomorphic application. It was taking 40 seconds to boot, and we were able to reduce it to 4-5 seconds

Since we use babel + marko, we need to run lasso-marko and lasso-babel-transform every time at boot, in order to build the client-side JS. I imagine this architecture is very common, since it's the one in the marko and lasso demos.

We have done a very simplistic caching of lasso-marko and lasso-babel-transform builds by using the components source code as cacheKey.

Assumptions:

If you guys think those assumptions make sense, I can send a PR to lasso-marko and another to lasso-babel-transform.