惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
Y
Y Combinator Blog
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
量子位
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
C
Cybersecurity and Infrastructure Security Agency CISA
L
Lohrmann on Cybersecurity
L
LINUX DO - 最新话题
The Register - Security
The Register - Security
T
Tailwind CSS Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
T
Troy Hunt's Blog
Stack Overflow Blog
Stack Overflow Blog
Cloudbric
Cloudbric
S
Secure Thoughts
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
L
LangChain Blog
Recorded Future
Recorded Future
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Tor Project blog
人人都是产品经理
人人都是产品经理
F
Full Disclosure
O
OpenAI News
Webroot Blog
Webroot Blog
A
Arctic Wolf
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
H
Heimdal Security Blog
B
Blog RSS Feed
Vercel News
Vercel News

博客园 - 超晨

jacob的使用方法 飞秋软件的OA消息接口服务器 c#关于数据库自定义类型在存储过程中返回服务器端的问题 vs2010 sp1在win2003不能安装的问题 jquery插件Uploadify使用中的注意事项 adsl拨号vpn后,adsl就不能用了 - 超晨 坑爹啊!!!win2003 x64企业版不支持tfs2010的源代码管理服务 mysql真是不错! gui设计禁忌2.0读书笔记 tfs2010中文版下载 iisExpress的设置 vs08+ie8开发遇到的问题 sql命令行添加一个登陆给某数据库,并给予指定角色(备忘) 消除数据库JS入侵的脚本 数据绑定到分页的快速开发最佳实践 SQL冗余字段的策略和管理 Windows 远程桌面不能连接解决办法zt Python企业应用的优缺点(zt) python应用领域介绍 (zt)
dataset绑定翻页和泛型+实体类绑定翻页的性能比较
超晨 · 2009-11-21 · via 博客园 - 超晨

        我所用的项目中,dataset用得比较多,一来开发速度快,二来培训成本低。而且dataset自身和gridview开发结合得很好,很多巧妙的方法用dataset来绑定比较好处理。比如动态字段、元数据字段,如果用泛型的话,会存在实体类的修改问题。有人会说dataset效率很低,其实不然,如果应用场景合适,性能带来的影响是几乎感觉不出来的。

         为了测试dataset性能到底如果,我把它和泛型+实体类的分页绑定方式做了对比。对比环境如下:

使用同一个工程的同一页面,使用同一个存储过程。表记录集为20W,600W,1900W。

测试时间为数据开始到绑定结束为止。

结果让人吃惊的是:首页及前面顺序翻页的情况下,每一种级别的两种方式分页的耗时都是差不多的,凭感觉并不能体验到性能差距或者说基本感觉不到。但,有一个很奇怪的地方,那就是每种数据库级别的尾页情况,倒着往前面翻页的时候,dataset绑定方式比泛型绑定方式慢了4~4.5倍!!!,并且泛型绑定方式保持了首尾翻页速度基本一致的性能。这真叫人想不明白,一样的存储过程,返回一样的记录,顺序翻页时候差距都不大,怎么倒着翻页差距就这么大呢?

看来,考虑到大数据量的场景,使用泛型还是有必要的 。