Skip to content
This repository

Partials rendering overhead #213

Closed
dimitarkolev opened this Issue May 13, 2012 · 7 comments

2 participants

Dimitar Kolev-Dick Benjamin Arthur Lupton
Dimitar Kolev-Dick

Hi when using partials in an eco layout there is huge overhead. It goes like this. If you put

<% console.log @document.url %>

Inside the layout its called twice for each document. But when partial is used

<%-@partial('test.html.eco', {parent: @documen.url})%>

And inside partial file you put

<% console.log @document.parent %>

The results is 10logs for each document from the partial. Using partials for large sites (100 pages) results in increase of the render time from 1s to 1min.

Benjamin Arthur Lupton
Owner

Hrmmm, performance can definitely be improved.

For a little background, each time we render something, we render it twice. The second time is so anything that references it, will have the rendered content, not the source content.

I'm not sure why you would be getting 10 logs however. Will look into it.

Dimitar Kolev-Dick

I dont think this is a performance issue its more likely that partials are rendered unnecessary multiple times on different points of the rendering process.

Benjamin Arthur Lupton
Owner

Scheduled for June.

Dimitar Kolev-Dick

Do you want me to prepare test project that illustrates the problem

Benjamin Arthur Lupton
Owner

Yeah that'll be great :)

Benjamin Arthur Lupton
Owner

@dimitarkolev can you let me know if v6.0.6 improves on the speed here at all? In term of differential rendering, I've noticed tremendous speed improvements. Would love to know if it resolves the performance problems here too.

Benjamin Arthur Lupton
Owner

Closing. Feel free to re-open if is still an issue.

Benjamin Arthur Lupton balupton closed this June 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.