[Dbix-class] some answers about the benchmarks

Dami Laurent (PJ) laurent.dami at justice.ge.ch
Thu Jul 5 07:12:10 GMT 2012


Hi all,

Several people reacted to my last post about benchmarks, or asked for more details.
Below is a compiled answer about some of these points.
(By the way, I'm sorry for having forgotten to put a subject line in my original post).

- as mentioned in the original post, the code for the benchmarks is available
  at https://github.com/damil/compare-ORM. It's fairly trivial stuff, yet (in my view)
  representative of a what applications often do, namely get data from the DBMS and
  output it in documents or HTML pages.

- benchmarks were run on Windows XP, Strawberry Perl 5.12.3, DBIx::Class 0.08196,
  DBD::SQLite 1.35. On request from Ribasushi, I also tried to benchmark
  the release candidate DBIx::Class 0.08197_04, but results were worse; he 
  is currently looking into that. 

- My focus was only on DBIx::Class vs. DBIx::DataModel, because they have a bunch of
  common points (born a the same time, both using SQL::Abstract, large intersection
  of features), and yet also a number of significant differences. I do not intend
  to extend the comparison to other ORMs; that would be a huge task ... but if anybody
  wants to adapt the benchmarks for other ORMs, they are welcome !

- Of course the next interesting step would be to NYTProf the results and study
  where improvements could be made ... but I'll leave that to the DBIC team !

- To me, the main lesson is : "beware of preconceived beliefs". From the doc or
  from DBIC tutorials, many people believe to make their apps faster by using
  HashRefInflator and/or prefetch; however the benchmarks show that this is not
  true, esp. with prefetch which apparently could make your app much slower.

- Also beware of preconceived beliefs when stating something like.
  "DBIDM is a bit faster yes, but it's also less flexible and robust".
  Here is not the place to argue, but to anybody interested, go to
  the doc (esp. https://metacpan.org/module/DBIx::DataModel::Doc::Design ), do
  some experiments, and find out by yourself.

Best regards, Laurent Dami



More information about the DBIx-Class mailing list