Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mufumbo opened this issue Jun 4, 2019 · 0 comments

Comments

@mufumbo
Copy link

mufumbo commented Jun 4, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant