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

Partials are slow in dust.js #384

Closed
giridharkn opened this issue Dec 16, 2013 · 7 comments
Closed

Partials are slow in dust.js #384

giridharkn opened this issue Dec 16, 2013 · 7 comments

Comments

@giridharkn
Copy link

Dust.js is best template engine....in my case much need of partials but as per linked in benchmark handlebars are good at partials.

http://linkedin.github.io/dustjs/benchmark/index.html

Please help me...

@jimmyhchan
Copy link
Contributor

Performance is very important to this project, but we are finishing a few feature requests before getting back to perf improvements.

@prashn64
Copy link
Contributor

Added a milestone for performance. We will get to it after either the 2.4 milestone or enhancing parameter passing.

@xjamundx
Copy link

I'm finding significant issue with performance when rendering templates with large numbers of partials. In some cases these take 1-3 seconds to render. Most of the time appears spent inside the clone function.

screenshot 2013-12-24 12 52 48

@rragan
Copy link
Contributor

rragan commented Dec 26, 2013

With the exception of path.js, those are all related to compiling dust templates to Javascript. If you are in a dev environment editing templates and hitting refresh a lot, then compiling on every run might make sense. For production use, you ought to compile to JS once and only execute the compiled JS.

@xjamundx
Copy link

Right and replacing (manually) the lines of the clone command in the compiled parser.js file with the folowing makes it work significantly faster (hat tip to @totherik):

function clone(object) {
    return {
        offset: object.offset,
        line: object.line,
        column: object.column,
        seenCR: object.seenCR
    };
}

@sethkinast
Copy link
Contributor

#497 uses a new version of the parser that no longer performs clone()

@maciejkowalski
Copy link

This should be closed, there is already a fix for that in #497

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

No branches or pull requests

7 participants