DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: hxh57738897
今日帖子: 27
在线用户: 8
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 earthsbest (全能中间件) ▲▲▲▲△ -
普通会员
2018/6/7 19:07:01
标题:
整型性能测试:Delphi 10.2 Tokyo 超越 Visual C ++ 和 Visual C# 浏览:2689
加入我的收藏
楼主: 原贴:https://forum.lazarus.freepascal.org/index.php/topic,36342.0.html
https://codingforspeed.com/integer-performance-comparison-for-c-c-delphi

欢迎围观。

一图胜千言:
此帖子包含附件:
PNG 图像
大小:46.5K
----------------------------------------------
Delphi4Linux Delphi三层/FireDAC 技术群:734515869 http://www.cnblogs.com/rtcmw
作者:
男 delphiilove (乌羽玉) ★☆☆☆☆ -
普通会员
2018/6/7 19:14:45
1楼: 好,强大。好强大,好强,大。
----------------------------------------------
-
作者:
男 tony2u (tony2u) ★☆☆☆☆ -
普通会员
2018/6/7 21:15:18
2楼: 我自己写了个例子,测试下来VC++2015-x64是最快的。
----------------------------------------------
-
作者:
男 majx (skin) ★☆☆☆☆ -
普通会员
2018/6/8 6:44:03
3楼: DELPHI 的Win64速度需要赶上来。
----------------------------------------------
majx,QQ 613354940
作者:
男 hq200306 (200306) ★☆☆☆☆ -
普通会员
2018/6/8 9:27:45
4楼: 这个测试例子不一定能评估Delphi与其他编译器的优劣,因为IsPrime,AtomicIncrement的实现都不一样,就10.2.3的AtomicIncrement所花的时间就比之前Delphi少得多,这个例子仅是说明调用的两个函数花的时间少了
----------------------------------------------
-
作者:
男 hq200306 (200306) ★☆☆☆☆ -
普通会员
2018/6/8 9:28:32
5楼: function Test2: integer;
var
  s: integer;
begin
  s := 0;
  TParallel.&For(1, MAXN, procedure(i: integer)
    begin
      if (IsPrime(i) = 1) then
      begin // memory barrier
        AtomicIncrement(s);
      end
    end);
  Result := s;
end;
----------------------------------------------
-
作者:
男 bigboy2050 (bigboy2050) ★☆☆☆☆ -
普通会员
2018/6/8 9:42:03
6楼: 有毛用,大家都知道 python 是世界上 速度最慢的脚本,

但是为啥 python能成为语言界的 当红大明星?


这是因为电脑性能越来越好, 这些都不是个事

重要的是  软件生态,有没有丰富好用 强大的 内裤


纵观天下大势,内裤才是决定一个开发语言能否成功的关键

而不再是编译器。。。。


看看世界上,还剩几家卖delphi 控件厂商?
死掉或转型的 delphi控件厂商有多少?

同样,java 和php 也比 c++慢,
但是他们的市场占有率都比 c++ c高。。。
----------------------------------------------
kittyapp
作者:
男 earthsbest (全能中间件) ▲▲▲▲△ -
普通会员
2018/6/8 11:19:55
7楼: 我想没几人看那过那原贴吧,就开喷了,呵呵。只是比较整型的性能而已,上面的测试也只是略有领先。

Delphi XE7 新增并行库-TParallel 能充分利用CPU性能,很多人的测试还是停留在简单 for i=0 to10000000 do ...... 这种低级代码上面。

作者还特别强调:and it is not about the language war! 喜欢喷人还是绕道吧。
----------------------------------------------
Delphi4Linux Delphi三层/FireDAC 技术群:734515869 http://www.cnblogs.com/rtcmw
作者:
男 zwjchinazwj (蒲石) ★☆☆☆☆ -
普通会员
2018/6/8 13:24:09
8楼:


ykot
Full Member
***
Posts: 141

Re: Integer Performance Test: Delphi 10.2 Tokyo outperforms Visual C++ and Visual C#
« Reply #14 on: March 28, 2017, 08:20:38 pm »
I have written a FreePascal version of the test, but using native threads directly and recompiled same application with Delphi. Tests conditions, configuration and target is the same. I have attached updated sources for FreePascal, Delphi and MSVC. If you recompile each of them, please make sure to enable all optimization options: Release mode for Delphi, "-OoLoopUnroll -OoFastMath -Sv -CpCoreI -CfSSE42 -OpCoreI" for FreePascal and "-Ox -GL" for MSVC.

Still, I'm getting the following figures for x64 target:

FreePascal (native): ~2400 ms
FreePascal (MTProcs): ~2840 ms
Delphi (native): ~1030 ms
Delphi (TParallel class): ~1010 ms
MSVC: ~710 ms

Out of curiousity, for 32-bit target:

FreePascal (native): ~1030 ms
Delphi (TParallel class): ~1030 ms
MSVC: ~730 ms

Srcstorm, I'm not sure how really you are compiling the projects, but your benchmarks seem to be rather bogus - in both 32-bit and 64-bit tests, Delphi is roughly 50% slower than the corresponding Visual Studio compiled project in both Win32 and Win64 targets. Also, I doubt there have been any changes to Win32/Win64 Delphi compilers in Delphi 10.2 (in fact, likely since the release of Delphi XE 2), so performance tests are likely the same for both Delphi 10.1 and 10.2. 

However, I still don't understand why FreePascal version is much slower for x64 target, even when using threads directly via "TThread" class. Perhaps the issue is actually in how "IsPrime" function gets compiled?
----------------------------------------------
-
作者:
男 zwjchinazwj (蒲石) ★☆☆☆☆ -
普通会员
2018/6/8 13:24:28
9楼: 请仔细看完整个帖子。

就我的理解,Delphi基本没有在编译器优化方面投入很多资源,不太可能有领先一说。往下翻了翻。果然有人做了测试,虽然我没有严格的测试对比,就我个人来讲,
我觉得ykot 的结论更可信。

当然,如果是拿并行运算与串行运算比。那么与语言,编译器无关了。就肯本没有比的必要了。
----------------------------------------------
-
作者:
男 keymark (嬲) ▲▲▲△△ -
普通会员
2018/6/8 13:59:20
10楼: 真想测试用
https://github.com/sisong/DGL.git
这个  每个版本编译对比下就行了。
和别的语言比?多余了。
----------------------------------------------
[alias]  co = clone --recurse-submodules  up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
作者:
男 draculamx (draculamx) ▲▲▲▲△ -
普通会员
2018/6/8 14:14:18
11楼: 我想问一下,把这个结论中的delphi换成C++ Builder是不是一样的?C++ Builder和delphi的速度相同的吗?
----------------------------------------------
C++ builder 用户前来摸鱼。。。
作者:
男 zwjchinazwj (蒲石) ★☆☆☆☆ -
普通会员
2018/6/8 14:29:14
12楼: Delphi is roughly 50% slower than the corresponding Visual Studio compiled project in both Win32 and Win64 targets.

C++Builder我估计不会太乐观。他们没精力做编译优化这样的事情(甚至有可能是没能力)
----------------------------------------------
-
作者:
男 starrysea (星海) ▲▲▲▲▲ -
普通会员
2018/6/8 23:41:59
13楼: c++ builder 应该是和Delphi差不多的, 他们底层优化应该是同一级别
----------------------------------------------
挂机赚钱 https://www.yiluzhuanqian.com/P3VpZD0zNjY0MA%3D%3D
作者:
男 yugong23 (yugong23) ▲▲▲▲△ -
普通会员
2018/6/9 0:45:09
14楼: Delphi的编译器 一直处于领先地位。 前些年有人提出要买编译器还是要公开代码,
公司回答, 我们靠它赚钱呢!
Delphi用户少, 原因之一是: 不免费还价格贵
----------------------------------------------
-
作者:
男 zyp1984 (小李他妈的飞刀) ★☆☆☆☆ -
普通会员
2018/6/10 13:42:41
15楼: delphi编译型,c#解释型,理论上delphi应该必须快过C#的
----------------------------------------------
山外青山楼外楼,能人背后有能人弄..
作者:
男 nevergrief (孤独骑士) ★☆☆☆☆ -
盒子活跃会员
2018/6/10 16:29:32
16楼: C# Delphi Python比较
https://www.academia.edu/18496549/A_Performance_Comparison_Of_C_2013_Delphi_Xe6_And_Python_3.4_Languages
----------------------------------------------
只有偏执狂才能生存!
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行78.125毫秒 RSS