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

stack new is very slow at compiling Mustache templates #4133

Closed
snoyberg opened this issue Jul 5, 2018 · 3 comments
Closed

stack new is very slow at compiling Mustache templates #4133

snoyberg opened this issue Jul 5, 2018 · 3 comments
Assignees

Comments

@snoyberg
Copy link
Contributor

snoyberg commented Jul 5, 2018

Actions:

  • Install a recent HEAD version of Stack. I'm using d5b5f77
  • Run stack new foo yesodweb/simple

Expect: it will generate the output in under 5 seconds

Actual: it takes a full minute to compile the Mustache template

I'm guessing the move over to mustache from hastache triggered this. The Yesod templates may be an extreme case because they include large base64-encoded binary blobs for images. I'll try applying the templates to one file at a time instead and see if it speeds things up.

CC @borsboom @JustusAdam

@snoyberg snoyberg added this to the P0: Blocking release milestone Jul 5, 2018
@snoyberg snoyberg self-assigned this Jul 5, 2018
@snoyberg
Copy link
Contributor Author

snoyberg commented Jul 5, 2018

I've determined that this can be triggered by trying to compile the bootstrap.css file, which weighs in at 149kb. Proposed workaround: I'm going to add an arbitrary limit to Stack.New to only apply mustache to files smaller than 50kb.

@JustusAdam
Copy link
Contributor

Hmm ... I wouldn't be surprised if that's the parser. Perhaps someone with more experience in writing parsers can take a look at it?

mihaimaruseac added a commit that referenced this issue Jul 8, 2018
Do not apply Mustache to large files (fixes #4133)
@snoyberg
Copy link
Contributor Author

snoyberg commented Jul 9, 2018

@JustusAdam I'd love to do so, but unfortunately I likely won't have time for that in the next few weeks at least, I've got a bunch of major things on my plate I'm going to have to focus on, sorry.

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

2 participants