Comparison of simple read/write performance of ADO. NET, NBear, nhib.pdf, and IbatisNet

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.