[LRUG] Recommendations for Ruby & Rails optimisation resources

Geoff Youngs g at intersect-uk.co.uk
Fri Nov 23 07:18:10 PST 2012


If it really is the templating language (which, at ~5secs sounds
unlikely, unless it's both huge and complex), then slim
(http://slim-lang.com/) is (IMO) even more elegant sourcewise than
haml and faster - see http://rdoc.info/github/stonean/slim#Benchmarks

There's an (imperfect) script for converting haml to slim as well,
which speeds up the process - https://github.com/fredwu/haml2slim

But it's also seriously worth considering using something like
newrelic, assuming you don't already.  It's pricey, but really useful
at identifying slow pages & highlighting where in the page the
slowness comes (it gives break downs of activerecord calls, web
services accessed via Net::HTTP etc in a timeline view).


On 23 November 2012 12:14, Jonathon Horsman <jonathon at arctickiwi.com> wrote:
> Hi
>
> I need to improve the performance of a particular Rails action.
>
> I'm using fragment caching which is helping a lot, but the initial cache
> generation is still in the order of 5 seconds.
>
> So I'm looking into the garbage collector, this article provided some hints
> but no suggestions:
> http://merbist.com/2010/07/29/object-allocation-why-you-should-care/
>
> 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?
> Is it better to use select_all and work directly with hashes?
>
> Is HAML markedly slower than ERB? The view generation seems to take the
> majority of time.
>
> I'd really appreciate any tips or links to articles.
>
> Many thanks
>
> --
> Jonathon Horsman
> Director
> Arctic Kiwi
> Mobile: 079 42366038
> Web: http://www.arctickiwi.com
> Twitter: @jhorsman
>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



-- 
Random Musing - http://www.frafferz.com/
Geek Blog - http://geoffyoungs.github.com/



More information about the Chat mailing list