I ported a very minimal part of AmethystRSS.net to Padrino. It looks good. Before I really start full-time, I tried out a few alternatives. Amethyst has an inherent responsiveness problem, e.g. rendering 300 partials with 5 links and a couple of bits of text while the user waits. Caching helps, the second time they access the list. And the list ages rapidly, 50-70 new items a day. Wait three days to check your RSS feeds and all 300 are new.
So I benchmarked some of the alternatives – 300 items, each with 2 links and a couple of bits of text in a zebra-striped table (CSS courtesy of Twitter’s Bootstrap project), MySQL (w/ mysql2 adapter), 2700+ items in the DB. Response times are measured in Firebug, i.e. end to end as seen from the browser, both it and the server on the same laptop. HAML is 8% slower than ERB. ERB is 2% slower than Erubis. DataMapper is 7% slower than ActiveRecord 3.1. This last one is a bit surprising. I’m going to dig into it a little more. Plus figuring out how to store all times in UTC and display them in the user’s local time in DataMapper.
None of the performance differences are deal killers. My templates are ERB, I’ll leave them that way. My models are written for ActiveRecord 2.3.x. I’ll stick with it unless I find out how to achieve a lot more speed with DataMapper.
If you select HAML during project generation, ERB is available too. This suggests the possibility of fast prototyping in HAML and converting frequently used templates to ERB when stable.
It is not the initial DB access that is slower in DataMapper. Using Ruby’s Benchmark module, timings are comparable, around 0.4ms. My next suspect is the attribute access in the views. Not clear how to time this.