1

In my new project I am keen to use .NET Entity Framework on Postgresql. So I first compared the performance of Entity Framework with simple SQL query. For this I developed a sample desktop application and ran it in both the modes, viz. with Entity Framework & with simple SQL query, in multi-threaded environment. I found that the performance of Entity Framework is 50% lower than that of SQL call. I am using NPGSQL for both the cases.

Performance is the critical success factor for my application and it is serving approximately 250-300 requests per second.

Please suggest whether I should go for Entity Framework or not. Or is there any tips and tricks for improving performance of EF to inline with simple SQL Calls. I am using .NET Framework 4.5.

5
  • Please read stackoverflow.com/tags/postgresql-performance/info and edit your PostgreSQL version, explain analyze results, exact query text, etc into the question. Comment here when you're done. Commented Jun 11, 2013 at 12:46
  • There is no issue in PostgreSQl performance. In our experiment also we got better performance with SQL calls than with the Entity Framework. PostgreSQL version is 9.2.3. Commented Jun 11, 2013 at 13:05
  • 2
    OK... so what's different, then? Are the queries different? It's kind of hard to tell if you don't show the queries.. Commented Jun 11, 2013 at 13:33
  • 2
    use an ORM (whatever it might be) when performance is the "Key point" looks like a nonsense. It's much (much) better for maintenability purposes, not for performance. Commented Jun 11, 2013 at 13:33
  • @Raphaël Although I gave +1 to your comment I don't think it is much (much) better for maintenability because when thinks don't work as expected you must deal with a thick and opaque layer of software between you and the DB. Commented Jun 11, 2013 at 15:36

1 Answer 1

0

In general, my experience is that there is a significant performance cost to moving away from hand-tuned SQL. The reason is that entity frameworks often don't have access to the understanding regarding what you really need or want. If performance is critical, there may still be some use cases for ORMs but in general you really need to be able to drop to SQL any time you are doing something beyond the simplest queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.