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 the source code haven't changed, then lasso-babel-transform doesn't need to run and we return the last run result.
if the source code haven't changed, then lasso-marko doesn't need to run and we return the last run result.
the worst case scenario would be if you upgrade marko or babel, the entire cache needs to be rebuilt. This is so rare that we assume it never happens. (but we should just put the lasso and babel package version as cacheKey)
If you guys think those assumptions make sense, I can send a PR to lasso-marko and another to lasso-babel-transform.
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 runlasso-marko
andlasso-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 themarko
andlasso
demos.We have done a very simplistic caching of
lasso-marko
andlasso-babel-transform
builds by using the componentssource code
ascacheKey
.Assumptions:
lasso-babel-transform
doesn't need to run and we return the last run result.lasso-marko
doesn't need to run and we return the last run result.marko
orbabel
, the entire cache needs to be rebuilt. This is so rare that we assume it never happens. (but we should just put the lasso and babelpackage version
ascacheKey
)If you guys think those assumptions make sense, I can send a PR to
lasso-marko
and another tolasso-babel-transform
.