ORMBattle.NETThe ORM tool shootout

  • Increase font size
  • Default font size
  • Decrease font size
Home Blog A honest comparison of Entity Framework and NHibernate?

A honest comparison of Entity Framework and NHibernate?

E-mail Print PDF

Here is the link. Check out my comments - there are plenty of them below the post. Currently the main question for me is: "Is it really true that EF is JUST 2 times slower than NH on this test, although it sends ~ 2500 queries vs ~ a single one in NH?"

Of course I admit there is either my own (it isn't fully clear what is ctx.EFCompanySet there) or Fabio's mistake. But at least for the first look it looks quite suspicious.

Anyway, EF test code is here:

using (var ctx = new EFContainer()) {
var companies = from c in ctx.EFCompanySet select c;
foreach (var company in companies) {
company.Employees.Load();
foreach (var employee in company.Employees)
employee.Reports.Load();
}
}

And NH test code:

IList<NHCompany> result;
using (var session = Sf.OpenSession()) {
// My comment: why I don't see similar lines in EF test?
// See e.g. this post.

result = session.GetNamedQuery("NHCompany.All").List<NHCompany>();
}
foreach (NHCompany company in result) {
writer.WriteLine(company);
foreach (NHEmployee employee in company.Employees) {
writer.WriteLine(employee);
foreach (NHReport report in employee.Reports) {
writer.WriteLine(report);
}
}
}

Since test code isn't available, I just quoted the code I found in Fabio's blog (in the first article from this cycle Fabio wrote to some other guy asking for the source code: "I’m working as consulter, if you want see the code I will happy to send you the price.", so I hardly have a chance to take a look at this beauty).

And... I feel I must quote few Fabio's sentences in the end:

  • "In this last weeks I saw the birth of a new Sport: Kick NHibernate." - but Fabio, in reality you devoted 3 posts to actually kick ORMBattle.NET ;)
  • "The next time you will see a competitions, before look at results, have a look to the driver." - no comments.
  • "Anyway my opinion about MDTD continuing being the same (MDTD = Monkey Driven Test Development)." - no comments as well.
P.S. If you don't know the story, Oren Eini (Ayende @ Rahien) and Fabio Maula, likely, are the most well-known criticizers of ORMBattle.NET. As well as the most known NHibernate developers.
Last Updated on Tuesday, 08 September 2009 14:10  

Polls

Which test must we add next?
 

Subscribe to our blog