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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 风焰庄主

React中,useContext+useReducer对比Redux React中,useReducer和useState 对三层架构的简单改进 .net程序在64位系统上报 未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序 问题解决 DropBox把目录设置在U盘里面的方法 工作过公司的体会--结构完整的企业其实还是挺吸引人的 努力与付出 微软用于写Javascript的一个插件,Script# 项目管理的一点想法 介绍一况挺好用的Javascript编辑器(带项目) 简单的C#进行图片操作 PHP访问C#建立的Webservice 搜索引擎一:介绍 纪念一下Jerry 在中信66楼微软Offic参加讲座 关于地理信息信息点数据采集一些方法 介绍一下JS调试和浏览器调试工具 服务器不支持WebResource.axd的特殊处理 嫦娥一号发射
python, C++, C# 计算速度简单对比
风焰庄主 · 2014-03-26 · via 博客园 - 风焰庄主

有个简单的运算,

 1 int n = 20000;
 2 ulong lResult = 0;
 3 for(int i = 0; i < n ; i ++)
 4 {
 5      for(  int j = 0; j < n; j ++)
 6      {
 7             lResult += (ulong) ( i * j );
 8      }
 9 }
10 return lResult;

阶乘,如果使用Python, c++和C#来运算,哪个会更快呢?

首先,Python直接就淘汰了,大概使用了90秒

我感觉C++肯定会非常优秀,我使用的是g++编译器。

确实非常优秀,使用了1.5秒60倍于Python的速度!

感觉C#会不会介于两者之间?

最后测试,C#运行下来,居然用了0.5秒

看来微软对C#的运行支持还是非常优秀的。g++编译器有点失望。