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

推荐订阅源

T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
V
V2EX
GbyAI
GbyAI
量子位
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
S
SegmentFault 最新的问题
O
OpenAI News
N
News and Events Feed by Topic
博客园 - Franky
爱范儿
爱范儿
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
Last Week in AI
Last Week in AI
罗磊的独立博客
Spread Privacy
Spread Privacy
Recent Announcements
Recent Announcements
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
Y
Y Combinator Blog
J
Java Code Geeks
I
Intezer

博客园 - yi

Rabbitmq的使用及Web监控工具使用 Fiddler的配置 轻松实现SQL Server与Access、Excel数据表间的导入导出 Sql server性能优化白皮书 索引的优化脚本 查找当前的登录用户 usp_who5脚本,查找当前的进程 锁与索引 一个数据访问层的小工具 转:对XML插入操作 - yi - 博客园 查看当前的连接和锁 对数据的分页再一次思考 关注商业价值 应用程序优化 关于异常处理的一点看法 骂的人多了,也成了真理 样式小记 - yi - 博客园 重命名你的数据库 不浪费自己的时间,同时也不浪费别人的时间 - yi - 博客园
linq to sql的性能和reader相比只是差一点点吗
yi · 2010-06-22 · via 博客园 - yi

     很多人认为linq to sql性能很不错,但我很可惜的告诉你,你错了,不是差一点点,是差非常多,差得让人可怕.

现把结果帖出来:

reader读取结果:

Report name:                  2010-6-22 23:01:24
Run on:                       2010-6-22 23:01:24
Run length:                   00:01:00

Web Application Stress Tool Version:1.1.293.1

Number of test clients:       1

Number of hits:               65919
Requests per Second:          1098.50

linq to sql读取的结果:

Report name:                  2010-6-22 23:03:05
Run on:                       2010-6-22 23:03:05
Run length:                   00:01:00

Web Application Stress Tool Version:1.1.293.1

Number of test clients:       1

Number of hits:               8673
Requests per Second:          144.54

我测试的数据库数据量:七十几W条,读取的数据为0

然后再测试有数据返回,返回记录数为两条,测试结果如下:

reader结果:

Report name:                  2010-6-22 23:17:10
Run on:                       2010-6-22 23:17:10
Run length:                   00:01:00

Web Application Stress Tool Version:1.1.293.1

Number of test clients:       1

Number of hits:               53138
Requests per Second:          885.63

linq to sql结果:

Report name:                  2010-6-22 23:15:50
Run on:                       2010-6-22 23:15:50
Run length:                   00:01:00

Web Application Stress Tool Version:1.1.293.1

Number of test clients:       1

Number of hits:               7161
Requests per Second:          119.35

然后多线程并发:

reader结果:

Report name:                  2010-6-22 23:28:15
Run on:                       2010-6-22 23:28:15
Run length:                   00:01:00

Web Application Stress Tool Version:1.1.293.1

Number of test clients:       1

Number of hits:               86210
Requests per Second:          1436.78

linq to sql结果:

Report name:                  2010-6-22 23:29:30
Run on:                       2010-6-22 23:29:30
Run length:                   00:01:01

Web Application Stress Tool Version:1.1.293.1

Number of test clients:       1

Number of hits:               14444
Requests per Second:          239.09

数据在上面,哥啥都不说了,性能差别大吗?数据在上面,我不想说。

为什么我只测试读取,其它不进行测试呢???读取的频率远高于插入,修改,删除,对于应用程序性能的问题大多数是出在读取,所以插入、修改、删除影响几乎影响不了应用程序性能,除了一些特殊的应用。