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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
S
Security @ Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
A
Arctic Wolf
Webroot Blog
Webroot Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Security Latest
Security Latest
H
Heimdal Security Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
T
Tor Project blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
The Last Watchdog
The Last Watchdog
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
A
About on SuperTechFans
M
MIT News - Artificial intelligence
V
V2EX
V
Visual Studio Blog
Recorded Future
Recorded Future
博客园 - 叶小钗
F
Fortinet All Blogs
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog
博客园 - Franky
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
I
InfoQ
SecWiki News
SecWiki News
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
B
Blog RSS Feed
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
H
Help Net Security

博客园 - 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
看来免费的东西还是不好使啊