Does anybody have experience that signifies what type of performance hit a developer could expect by selecting to make use of an ORM (in Django, RoR, SQLAlechemy, etc) over SQL and hands-designed databases? I imagine you will find further complicating issues, including whether indicating a database inside the constraints of the ORM increases or decreases the likelihood of creating a competent database structure (in line with the developer's degree of experience), and also the question of methods well the developer constructs either the SQL or ORM-based queries (again according to his/her experience). Any specifics of these or intrinsic performance issues could be interesting in my experience.

Make an effort to never fear relating to this until you have to - don't optimise prematurely. An ORM can offer benefits to development speed, code readability and may remove lots of code repetition. I would suggest using one if it'll make the application simpler to build up.

While you progress with the development use benchmarks and profiling to look for the bottlenecks within the code and when needed you are able to bypass the ORM and employ manual queries where they're needed. Normally you'll have the ability to enhance the speed from the ORM using caching and database indexes (among other activities) and you can decide where manual queries are needed. Typically, the ORM performance will most likely acceptable and the advantages of utilizing it will far over-shadow the performance cost.

See ORMBattle.Internet - its peformance tests are made exactly for this function. There's "SqlClient" column showing peak possible performance of same procedures performed directly.

Performance happens to be an after thought in many DAL Layer development / architecture. I believe its time starting questioning the performance of those ORM tools, for that so-known as easy development they promise:

The Two greatest regions of performance issues in ORMs are:

  1. Lack of ability to create Optimum SQL. Make use of an item Query Language that is construed into SQL through the framework. Mostly it's good SQL, but frequently enough it's not the best SQL.

  2. Reflection. Most ORM frameworks use Reflection to populate objects with Data in the database. Reflection procedures are pricey, with growing quantity of load and data, the performance degradation becomes apparent.

Other performance problems that arise are due to inefficient Database Design or Entity Model design because of the tight coupling of Entity objects to Tables.

Additionally, it is dependent on which you are using being an ORM. In my opinion, Hibernate is really a pig, when it comes to speed, resource usage and startup time. LINQ to SQL, however, is definitely an very light SQL wrapper, whose impact you'd likely barely (if whatsoever) notice.

It all depends a great deal around the that which you compare it with. The the coder writing the hands code is really a total hack it may be a boon as opposed to a hit. Clearly sometimes it can go another way too.