I was considering a fast-performing and scalable platform for high performance web application that also uses a database intensively. And it seemed to me that the natural approach is to pick some MVC framework like Rails, .NET MVC or Django. I've already had experience with both Rails and .NET but not with Python. And as far as my personal testing have shown C# with .NET MVC3 in most cases outperforms the Ruby on Rails 3 (for Rails I've used the unicorn and nginx for the http stuff). Anyone have some observations on that, or was my tests incorrectly held? Any examples with numbers and explanations would be highly appreciated. Thank you!
The performance shouldn't be a dealbreaker when choosing a webframework, at least not when you are choosing from those 3, which are really proven in the battlefield.
If you just consider the language speed, C# - which is statically typed and JIT compiled, will always be the fastest. Python will come next (especially if you'll run Django on PyPy - which also does have a JIT, however not that mature) and Ruby will be the slowest (it always was, although it's improving).
Beside the language the database itself plays a big role, so lot depends on an ORM that given framework uses. Again, Entity Framework (which you're probably using with ASP.NET MVC) will be hardest to use inefficiently since lazy loading isn't a common practice there and the database model is created by hand usually. In Django, on the other hand, you write the model in Python, which sometimes may be too general out of the box.
Don't forget that when DB plays a crucial role, proper caching will always be the key factor regarding the performance. In contrast to ASP.NET MVC, Django and RoR are full stack frameworks and will give you more options out of the box, since they know all they need about models.
EDIT: If you want pure language speed comparison, have a look at http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=csharp&lang2=yarv Read all the disclaimers (it's a benchmark of specific algorithm implementations that were ran on specific interpreter/compiler implemenentations so that's just a benchmark of those implementations) but keep in mind, that the C# implementation tested there is open source Mono version which for sure is slower than original MS Stack. So the differences you can see (c# implementation being 79 times faster than Ruby) may be even bigger.
At least in terms of Rails vs Django it clearly looks like the latter IS faster, according to these benchmarks
With ASP.NET MVC it looks more like there is some kind of conspiracy so no one actually tries to benchmark it :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With