2
votes

I have the following hierarchy of partials rendering which results in a table

  • render: partial => table
    • render: partial => row,: collection => rows
    • ---- render: partial => cell,: collection => row.cells
    • -------render: partial => "# {cell.partial}",: locals => {: item => cell.item}

In prodakshion renedering 5000 rows takes 12 seconds

At the same PC - "Web interface Oracle" draws the same 5000 lines in 2 seconds. That is 6 times faster.

What's the problem? How can i optimize rails performace ?

We are using the slim, but with haml it's the same Working on windows...

Moving partials to helper methods gives me 3x speed!

1
To optimize anything it helps to know what is slow and starting there, have you profiled the code?Devin M
i've got a problem with profiling cause i am using windows as development platform. But all partials are like == item.textYegor Razumovsky

1 Answers

4
votes

here is the problem: small partials are not efficient. Use helpers instead.

When I changed "render small partial" to "call helper method" I got 5x rendering performance.

Sad but true