Download the test sample program (see the description file in the compressed package: initial data and database modification link before running)
Test code based on TeddySimple read/write Performance Comparison Between ADO. NET, NBear, and nhib.pdfModify the test code in.
Major changes:
1. Test ADO. NET using microsoft's SqlHelper.
2. The referenced versions are: NBear V3.7.2.4, IBatisNet V1.6.1, and NHibernate1.0.1.0 for net1.1.
3. Use Stopwatch timing
Note (reference the original Teddy test article ):
In this test, we use the Categories, MERS MERs, and Products tables of the Northwind database (1000 data entries for each initial table) to test and compare the read/write performance of ADO. NET, NBear, and NHibernate. To be fair, the test code does not use many unique functions or caches of the special framework. Pre-read is performed before the actual test (ensure that metadata is loaded at the first run ).
Each read Test cyclically reads all data from three tables: Categories, MERS MERs, and Products. The three components return DataSet, strongly typed object array, and IList. Although the returned data types are different, in fact, it includes filling the returned data. Therefore, it should be relatively fair. The three ORM products use the one-to-one form for the Product table data list (that is, the Product information contains the Category information)
The results show that the performance of NBear is similar to that of ADO. NET; the performance of NHibernate is about 5 times worse.
Each write test creates, updates, and deletes each record in the Categories, MERS MERs, and Products tables. Since ADO. NET directly executes SQL statements, the fastest speed is affirmative.
NBear is about three times slower than ADO. NET, and nhib.pdf is about two times slower.
Generally, system read operations are much more frequently than write operations,
The average performance of NBear should be much better than that of nhib.pdf.
The test is not complete. It is for reference only. If the test code is incorrect, correct it.
My test results: nbear has the worst performance. (There is a big gap with the teddy test. The black-gray background shows the original Teddy test results)
The program runs in console mode, and Release compiles and runs three times. The result is 3rd Times.