This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have been testing the difference in speed between an ORM (NHibernate in this case), and standard SQL use With SQLCommand etc. I have a table With 44 MILLION records, and ran a few tests to see the difference in speed. Here are my results: NHIB Single record by ID: 0,8760876 sec. NHIB 1000 records by ID: 0,0590059 sec. NHIB 11269 records by date: 6,2876287 sec. Normal Single record by ID: 0,0020002 sec. Normal 1000 records by ID: 0,0010001 sec. Normal 11269 records by date: 0,0070007 sec. As you can see, there is quite a significant difference. Selecting >10000 records between 2 dates (the date Field is indexed), takes Close to 1000 times more time when using NHibernate. Is this normal? These results are enough for me to drop NHiberante (or any other ORM) as a tool all together. Any views on this? EDIT: Actually the first test (NHIB single record) is a bit wrong, as it includes the creation of the NHib session. It should be more like 0,03 sec. But that does not change the problem. |
|
|
Are you actually enumerating every row and every field in those timing? In particular the difference between your single record and 1000 record times seem a bit suspect. You can expect NHibernate to be slower than raw ADO.NET as there is no object materialisation cost involved with iterating over a data reader.
|
|