Performance Comparison Between dataset-bound paging and generic + object-class Paging

Source: Internet
Author: User

In my projects, dataset is used a lot, which leads to fast development and low training costs. In addition, dataset itself works well with the development of gridview, and many clever methods use dataset to bind them for better processing. For example, dynamic fields and metadata fields. If the generic type is used, the modification of the object class may occur. Some people may say that dataset is very inefficient. In fact, if the application scenario is suitable, the performance impact will be almost invisible.

 

To test the dataset performance, I compared it with the paging binding method of the generic + entity class. The comparison environment is as follows:

Use the same stored procedure on the same page of the same project. The table record set is 20 W, 600 W, and 1900 W.

The test time is from data start to end of binding.

The results are surprising: in the case of page turning and the previous page turning, the paging time of each of the two methods is almost the same, you cannot experience the performance gap or the basic perception. However, there is a strange thing, that is, the last page of each database level. When turning to the front page, the dataset binding method is four to four times slower than the generic binding method ~ 4.5 times !!!, In addition, the generic binding mode ensures the same speed of page turning at the beginning and end. This is really hard to understand. For the same stored procedure, the same records are returned, and there is not much difference between page turning in order. Why is the gap between page turning in order so big?

 

It seems that, considering the large data volume scenario, it is necessary to use generics.

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.