<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I think Diaspora were having a similar issue to you and wrote the following post about how they solved it</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><a href="http://devblog.joindiaspora.com/2012/01/10/client-side-re-write-oh-my/" target="_blank" style="color:rgb(17,85,204)">http://devblog.joindiaspora.com/2012/01/10/client-side-re-write-oh-my/</a></div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
TL;DR</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
"The easiest way to optimize the server’s rendering of templates is to not have the server render the templates. We can do this by having by pushing rendering logic client-side..."<br><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Personally I'm a big fan of this approach and like to use as little of the Rails view layer as possible. Among other things I think that can help your design because you don't have to deal with form helpers that are coupled to active record.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div><br></div><div>Bestie.</div></div><br><br><div class="gmail_quote">On 26 November 2012 08:14, Jonathon Horsman <span dir="ltr"><<a href="mailto:jonathon@arctickiwi.com" target="_blank">jonathon@arctickiwi.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for all the suggestions.<div><br></div><div>I've added the new relic gem and looked at the results, which seem a bit light on details unless I'm missing something.</div>
<div><br></div><div>According to the results of the slow action, SQL is about 8% of the time and the action itself is 89% (2799ms). Presumably this is mostly the view?<br>
</div><div><br></div><div>However there doesn't seem to be any way to drill into this and isolate what is taking the time.</div><div><br></div><div>I should mention a table is being rendered with 363 rows is being rendered, and the total page size is 338kb of HTML.</div>

<div><br></div><div>Are there other tools which can measure metrics?</div><div><br></div><div>Many thanks</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 23 November 2012 18:52, Sam Livingston-Gray <span dir="ltr"><<a href="mailto:geeksam@gmail.com" target="_blank">geeksam@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF"><div>Forgot to reply to list for posterity.<div><br><br><div>--</div>(Sent from phone; please excuse brevity.)</div>

</div><div><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> Sam Livingston-Gray <<a href="mailto:geeksam@gmail.com" target="_blank">geeksam@gmail.com</a>><br><b>Date:</b> November 23, 2012 8:44:29 AM PST<br>

<b>To:</b> Jonathon Horsman <<a href="mailto:jonathon@arctickiwi.com" target="_blank">jonathon@arctickiwi.com</a>><div><br><b>Subject:</b> <b>Re: [LRUG] Recommendations for Ruby & Rails optimisation resources</b><br>

<br></div></div></blockquote><div><div><div></div><blockquote type="cite"><div><div>Without metrics, "optimisation"=="random guesses". I highly recommend NewRelic; you can install the gem and run it locally on your app in dev mode for free. It's great for finding low-hanging fruit. (They're a bunch of really nice people, too.)<br>

<br><div>--</div>(Sent from phone; please excuse brevity.)</div><div><br>On Nov 23, 2012, at 4:14 AM, Jonathon Horsman <<a href="mailto:jonathon@arctickiwi.com" target="_blank">jonathon@arctickiwi.com</a>> wrote:<br>

<br></div><div></div><blockquote type="cite"><div>Hi<div><br></div><div>I need to improve the performance of a particular Rails action.</div><div><br></div><div>I'm using fragment caching which is helping a lot, but the initial cache generation is still in the order of 5 seconds.</div>


<div><br></div><div>So I'm looking into the garbage collector, this article provided some hints but no suggestions: <a href="http://merbist.com/2010/07/29/object-allocation-why-you-should-care/" target="_blank">http://merbist.com/2010/07/29/object-allocation-why-you-should-care/</a></div>


<div><br></div><div>e.g. how do I reduce the amount of object allocation in Rails? Should I be using the select() method in ActiveRecord to reduce initialized fields?</div><div>Is it better to use select_all and work directly with hashes?</div>


<div><br></div><div>Is HAML markedly slower than ERB? The view generation seems to take the majority of time.</div><div><br></div><div>I'd really appreciate any tips or links to articles.</div><div><br></div><div>Many thanks<br clear="all">


<div><br></div>-- <br>Jonathon Horsman<br>Director<div>Arctic Kiwi<br>Mobile: 079 42366038<br>Web: <a style="color:rgb(0,153,0)" href="http://www.arctickiwi.com" target="_blank">http://www.arctickiwi.com</a><div>Twitter: <a style="color:rgb(0,153,0)" href="http://www.twitter.com/jhorsman" target="_blank">@jhorsman</a><br>


<img><br></div></div><br>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Chat mailing list</span><br><span><a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a></span><br>

<span><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></span><br></div></blockquote></div></blockquote></div></div></div><br>_______________________________________________<br>


Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jonathon Horsman<br>Director<div>Arctic Kiwi<br>Mobile: 079 42366038<br>Web: <a style="color:rgb(0,153,0)" href="http://www.arctickiwi.com" target="_blank">http://www.arctickiwi.com</a><div>

Twitter: <a style="color:rgb(0,153,0)" href="http://www.twitter.com/jhorsman" target="_blank">@jhorsman</a><br><img><br></div></div><br>
</div>
</div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br>