C # ASP.NET MVC3 outperforms Ruby on Rails 3, Django?

I was considering a high-speed and scalable platform for a high-performance web application that also uses the database heavily. And it seemed to me that the natural approach is to choose some MVC infrastructure, such as Rails, .NET MVC, or Django. I already had experience with Rails and .NET, but not with Python. And since my personal testing showed that C # with .NET MVC3 in most cases is superior to Ruby on Rails 3 (for Rails, I used unicorn and nginx for HTTP material). Anyone have any comments on this, or were my tests wrong? Any examples with numbers and explanations would be highly appreciated. Thanks!

+4
source share
3 answers

At least from the point of view of Rails vs Django, it clearly looks like the latter is faster, according to these tests

With ASP.NET MVC, it looks more like some kind of conspiracy, so no one is trying to compare it :)

+4
source

Performance should not be a decisive factor when choosing web graphics, at least not when you choose from those 3 that are truly proven on the battlefield.

If you are just considering the speed of a language, C #, which is statically typed and compiled by JIT, will always be the fastest. Next comes Python (especially if you run Django on PyPy - which also has JIT, but not this mature one), and Ruby will be the slowest (it has always been, although it has improved).

In addition to the language, the database itself plays a large role, so much depends on the ORM that is used to use the framework. Again, the Entity Framework (which you probably use with ASP.NET MVC) will be harder to use inefficiently, since lazy loading is not a common practice, and a database model is created manually. In Django, on the other hand, you write a model in Python that can sometimes be too general out of the box.

Remember that when a database plays a crucial role, proper caching will always be a key factor in terms of performance. Unlike ASP.NET MVC, Django and RoR are complete stack frameworks and provide you with more options out of the box as they know everything they need about models.

EDIT: If you want to compare the comparison speed in the language, see http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=csharp&lang2=yarv Read all disclaimers (this is a benchmark of certain implementations of the algorithm that were run on specific interpreter / compiler implementations to just evaluate those implementations), but keep in mind that the C #-tested version has the open source version Mono, which is undoubtedly slower than the original MS Stack. So the differences you can see (the C # implementation is 79 times faster than Ruby) can be even greater.

+12
source

Django has many clever caching mechanisms. In addition, he encourages DRY, often resulting in cleaner code with less clutter, which is worth the performance. It is also very easy to configure what types of middleware you want to connect to each request process.

Thus, my argument will not be that Django is necessarily faster than ASP.NET, but simply that people write better projects, which in the end turn out to be faster.

+3
source

All Articles