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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 风焰庄主

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++编译器有点失望。