On Jan 30, 4:06 am, “Marston A.” [email protected] wrote:
Besides the fact that from these testsDjango
seems to be whooping serious butt on all fronts, it shows that Rails
1.2.1 seems to be trailing in performance (quite a bit in some places)
in comparison to 1.1.6. Anyone seen the same thing in a production
site?
I’m curious if there is anything significantly missing in these tests
and howDjangogot such great numbers (Or maybe it is just that
efficient? I have no realPython/Djangoexperience.). Thoughts?
Django is just that efficient.
But there’s a reason for that, and I bring it up here in the hope of
fostering a good discussion rather than simply “rah-rahing” Django,
the Python framework that I’m involved in developing.
We made fundamental decisions in Django that eschewed magic in favor
of a bit more explicitness. Plus, performance was baked into the
framework from Day One, rather than us taking a “we’ll make it
efficient later” stance. As a result, Django doesn’t have to do as
many things dynamically as Rails does.
The tradeoff is that, in Django, you’ll have to use an import
statement if you want to use a certain bit of code, rather than the
code magically being available to you. The tradeoff is that, in
Django, you define your database models in Python code rather than
having the framework introspect the database at runtime. Overall, the
tradeoff is that, in Django, you’re a tiny bit more explicit.
Of course, this isn’t an “I hate my job, this is so tedious” level of
explicitness – Django is, after all, intended to save you a ton of
time. It’s more like a pragmatic level of explicitness. And it has
some nice side benefits, such as the aforementioned performance
benefit (which is important) and the fact that explicit code is more
“discoverable” (i.e., it’s easier to poke into the framework to see
what’s actually happening).
If you give Django a shot, I’m pretty sure these differences will jump
out at you. Whether you appreciate the difference is completely a
personal decision, and no amount of marketing is going to change your
mind. (Well, for most people.) The difference between Rails and Django
programmers seems to be the programmers’ tolerance for magic.
Performance is a nice side benefit of less magic.
Adrian
–
Adrian Holovaty
holovaty.com | djangoproject.com