Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I optimize Mustache rendering speed when rendering 8000+ items?
    primarykey
    data
    text
    <p>I'm trying to render a table so the template is pretty simple; the row template looks like this:</p> <pre><code> &lt;script type=\"text/mustache\" id=\"template-list-records\"&gt; {{#.}} &lt;tr&gt; &lt;td&gt;{{airport_code}}&lt;/td&gt; &lt;td&gt;{{city_code}}&lt;/td&gt; &lt;td class=\"pull-right\"&gt; [&lt;a href=\"result.mics?m_uid={{airport_code}}\" class=\"listlink\"&gt;details&lt;/a&gt;] &lt;/td&gt; &lt;/tr&gt; {{/.}} &lt;/script&gt; </code></pre> <p>The problem is that rendering speeds starts to slow down exponentially when rendering more than 1000 results (I'm guessing it slows down exponentially all the time :) but with 1000+ results is noticeable that rendering speed is not linear). Now, at 4000 results, the page loads in 2.3 seconds. At 7000 results, rendering time is 7.3 seconds, and rendering the full result set (around 8500 results) takes 10 seconds. Now, I don't need to speed it up faster than 8 seconds for full result load (since that's the amount of time that the old functionality took to render the page), that would be a bonus :), but I still need to shave 2 seconds. I've looked at the Timeline inspector, the time is spent on rendering; rendering starts after 2.5 seconds.</p> <p>I'm guessing part of the problem could be my laptop (I have some graphic card issues), but still, I'm interested if there's a way to speed this up, e.g. precompile the table with 8500 rows and add/remove rows if needed (this really is an airport list table so the number doesn't change often, and when it does, it doesn't change by much).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload