-
Notifications
You must be signed in to change notification settings - Fork 34
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
Performance issues with including partials {{> ... }} #32
Comments
Also, parsing, in this case at least, when using {{> ... }} seems to be O(n) where n is the size of the template that is included. I've tested with a 50KB Ideally including plain HTML should be O(1) and the performance of parsing the template should be a function of executing the mustaches. Worse thing is that this ends up causing a segmentation fault in Julia after serving a few requests with HttpServer. How soon this happens is correlated to the size of the mustache templates (though it may not be directly the fault of this package, it does seem to trigger this behavior). |
I added a |
Thanks! All right, so I should use {{ < ... }} which will just include the indicated file without parsing it. Basically, this would only work if we'd be able to combine both {{ > ... }} and {{ < ... }} while taking care to extract most "dumb" markup into partials included via {{ < ... }} and putting mustaches into very small partials using {{ > ... }}. Right? But we would not be able to use {{ > ... }} into a file included with {{ < ... }} -- which might be a big constraint. I'll give it a try and follow up if it doesn't work. |
Yeah, that's it. The parsing part is the big performance killer, this On Wednesday, August 10, 2016, Adrian Salceanu [email protected]
John Verzani |
Got it, thanks! |
There seem to be some pretty bad performance issues with {{> ... }}
For example in my code I get this measurements after the initial run:
The first line reads the template
index.mustache.jl
which is this:While
block_articles.mustache.jl
is a 6KB plain HTML file (no mustaches).The culprit seems to be
{{> app/resources/dashboard/views/block_articles.mustache.jl }}
. If I include the content ofblock_articles.mustache.jl
directly intoindex.mustache.jl
,@time
will outputThe text was updated successfully, but these errors were encountered: