snax

ruby performance

introduction to camping presentation

commenting

Commenting is fixed, better than ever. As an experiment, try making a duplicate post.

August 20, 2007

10 comments

Dr Nic says (October 06, 2006):

That’s a grand introduction.

Is running Camping in production as simple as starting it with mongrel and pointing apache @ the port? I’m a spaz at this sort of thing.

evan says (October 06, 2006):

It can be. It depends if you need per-application database configuration.

I am going to release an init.d script later this week that makes it super easy.

Dr Nic says (October 06, 2006):

I made the homepage.rb example work. I feel like a god.

I shall cease asking questions til I have an intelligent one to ask.

Fred says (October 06, 2006):

Some people other than that one Ubuntu64 dude just hate flash. Or they appreciate stuff like a BACK button or a working PGup PGdown. People like me.

Tap says (October 06, 2006):

You might want to set the MIME type of the PDF to something more accurate than text/plain. Say, application/pdf.

evan says (October 07, 2006):

Fixed, thanks. They were getting mistakenly proxied through to mongrel.

ubuntu64dude says (October 07, 2006):

No, seriously, thanks.

Devin Ben-Hur says (October 07, 2006):

The slides worked fine on my Ub64. Some mixed arch magic.

I really like the look of Markaby vs erb soup. Anyone have numbers on how the rendering performance compares?

mark says (October 07, 2006):

Can you expand a bit on the “like HAML, but older, better” comparison for Markaby. I am currently trying to decide which one to use or, better yet, in what situations each one is preferable.

evan says (October 10, 2006):

Devin, Mark:

Markaby’s performance compared to ERb is not good. Markaby requires rendering steps for every tag and property, whereas rhtml can dump the tag text directly into the response since it’s prerendered. With page/fragment caching in Rails this can be somewhat mitigated. It depends a lot on your application and server resources.

I like Markaby over HAML because Markaby doesn’t create its own syntax. It’s not whitespace-sensitive; it can be highlighted by your editor already; and because it executes in Rubyspace instead of being parsed (like HAML) it supports all existing Ruby techniques, metaprogramming, and overrides (unlike HAML). This is very valuable to me. Speedwise I would guess they are comparable but I don’t have real data to go by. Unless there is a big speed difference, there is no situation in which I would use HAML over Markaby. That’s partly my personal preference, though.

A big benefit of Markaby is that strings passed as parameters get escaped by default. This means you tend to overescape rather than under, and makes it very easy to write an XSS-secure app.

Comments are closed.