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

推荐订阅源

Help Net Security
Help Net Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threat Research - Cisco Blogs
K
Kaspersky official blog
NISL@THU
NISL@THU
S
Securelist
P
Privacy International News Feed
Simon Willison's Weblog
Simon Willison's Weblog
T
Troy Hunt's Blog
Last Week in AI
Last Week in AI
量子位
WordPress大学
WordPress大学
Y
Y Combinator Blog
GbyAI
GbyAI
T
Threatpost
S
Schneier on Security
C
Check Point Blog
B
Blog RSS Feed
S
Secure Thoughts
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Latest news
Latest news
L
LINUX DO - 最新话题
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
博客园 - 三生石上(FineUI控件)
Hacker News: Ask HN
Hacker News: Ask HN
The GitHub Blog
The GitHub Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
U
Unit 42
L
LINUX DO - 热门话题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
Google Online Security Blog
Google Online Security Blog
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security Affairs

博客园 - Tobin

41岁的大龄程序员,苟着苟着,要为以后做打算了 UC_Center整合单点登录后远程注册不激活问题的解决办法 AspExe - a small ASP.NET compiler and executor for document generation 在as3中Embed(绑定)flash动画元素 - Tobin - 博客园 Embedding Resources with AS3 Configure the max limit for concurrent TCP connections [转]翻译:使用.net3.5的缓存池和SocketAsyncEventArgs类创建socket服务器 强制将IE,Chrome设置为指定兼容模式来解析(转) - Tobin - 博客园 工商银行,千万别用,转账不成功一样收手续费 MySQL vs NoSQL 效率与成本之争(转) 使用ASP.NET Global.asax 文件(转) [MySql识记]create utf8 database - Tobin 由浅到深了解JavaScript类[转过来的收藏] javascript改变this指针 哪个美女最漂亮,自己写的js图片自适应切换 javascript操作cookie实例 [图解] 你不知道的 JavaScript - “this”(转) 对与list<>泛型的一些操作方法 关于游戏开发中的A*/A-star的寻路算法的问题
npgsql连接postgresql数据库
Tobin · 2009-08-05 · via 博客园 - Tobin

国家现在开始抓盗版了,无奈,.net平台实在是比较贵的,但又不像放弃.net,只能把.netframework换成mono,把sql server换成postgresql,刚刚着手学习

今天测试用

npgsql 连postgresql的效率

对比

ado.net连sql server

代码很简单:

double firstms = 0.0,secondms=0.0;
 
for (int i = 0; i < 1000; i++)
            {
                Npgsql.NpgsqlConnection conn 
= new NpgsqlConnection(ConnStr);
                conn.Open();
                conn.Close();
            }
            DateTime endtime
=DateTime.Now;
            firstms
=endtime.Subtract(begintime).TotalMilliseconds;
DateTime begintime1 
= DateTime.Now;
            
for (int i = 0; i < 1000; i++)
            {
                SqlConnection sqlConn 
= new SqlConnection(sqlConnStr);
                sqlConn.Open();
                sqlConn.Close();
            }
            DateTime endtime1 
= DateTime.Now;
            secondms 
= endtime1.Subtract(begintime1).TotalMilliseconds;
            Response.Write(
string.Format("postgresql:{0},mssql:{1}",firstms,secondms));

代码很简单,但测试结果却不能让人满意:
postgresql:531.25,mssql:15.625
postgresql:515.625,mssql:15.625
postgresql:531.25,mssql:15.625
postgresql:515.625,mssql:0
postgresql:531.25,mssql:0
看来免费的东西还是不好使啊