On 15 Sep 2008, at 16:32, Kyle M. wrote:
Cool. What are the performance benefits exactly?
I don’t know, exactly. It seems the general consensus is that it is
more performant. I’m not skilled enough, so that’s what I have to go
off of. If you think otherwise, I’d gladly hear it.
I don’t want to port to Merb when I don’t have to.
It doesn’t necessarily need to be to be honest and if it is, then for
most applications the benefit could be well below your expectations.
Merb by nature is more lightweight than Rails and it also has a few
fundamental concepts that could be beneficial to certain developers.
Merb has always been about giving the developer a broader choice when
it comes to building your MVC stack: your models can use ActiveRecord
(which will be just as fast as ActiveRecord in Rails, since they are
exactly the same) or DataMapper or Sequel or . It’s a bit like putting together a custom built-computer vs
getting a well balanced and completely outfitted one. If you know what
you are doing and you have a very clear understanding on where Merb
will make your app faster, you should choose Merb. It’s more of a
hacker’s framework and some people that have done pure Ruby
programming with their own framework will in fact like Merb better
because of its openness.
Rails is a full stack framework. It’s opinionated in every way and
makes choices for you. ActiveRecord, ActionPack (ActionView and
ActionController), ActiveSupport, Prototype/Scriptaculous, Rails makes
them work together and makes sure you don’t have to write a single
line of code to do so. You can still take one of the components out
and replace it with your own preference, but it will either make you
lose features or force you to implement all code to make them work
together with the rest of framework yourself.
From what I can see, the concept of Merb being faster than Rails is
based on comments from the past. Most of them have to do with Merb
being threadsafe and Rails being single threaded. But, if you look
back at the speed of Rails 1.1.6 (when the whole Merb being so much
faster blog posts started appearing) and compare it to Rails >2, the
difference is huge. There has changed so much in the last year that
you can’t just compare the comments from then to how Rails performs
right now. Also, the good thing about opensource projects is they can
borrow ideas from each other. Rails 2.2 will be threadsafe for one. If
it will make such a dramatic difference is to be seen, but it will
sound good in one of those tech meetings in enterprises, that’s for
sure.
Like some of the other people replied, don’t assume switching to Merb
will make your app so much better. It’s another framework to get used
to and unless you have a real deep understanding of Ruby, you’ll hit
more walls with Merb than you ever will when using Rails.
That said, I love Merb just as much as I love Rails, and the choice
for either one would depend on the project. However, if I would be new
to Ruby instead of working fulltime on Rails apps for over two or
three years now, I would never ever go for Merb. It’s better having a
big brother like Rails forcing you to be civilized and structured than
having the “do-whatever-you-want” attitude of Merb.
Best regards
Peter De Berdt