1
deplivesb 2022-04-09 22:10:44 +08:00
|
2
Kinnice 2022-04-09 22:28:10 +08:00
calc time:5106.1282157898
all time:8583.1022262573 |
6
2Nfree 2022-04-09 22:41:29 +08:00
calc time:2897.068977356
all time:6620.0299263% arm64 7Cores 16G |
7
Jxnujason 2022-04-09 22:46:51 +08:00
|
8
Xusually 2022-04-09 22:48:25 +08:00
calc time:2439.4578933716
all time:3922.2249984741 MacbookPro 16 寸 M1 Max 32G 10+24 |
9
casper13 2022-04-09 22:49:41 +08:00
calc time:4346.0350036621
all time:6829.5969963074 i5-11320h/16g |
10
A01514035 2022-04-09 22:51:23 +08:00
calc time:4198.469877243
all time:12756.875038147 MacBook Pro (15-inch, 2019). 2.3 GHz 八核 Intel Core i9 |
11
aloxaf 2022-04-09 22:51:59 +08:00
你这只能测单线程性能,哪里直观了
试了下 3970x 还没 i7-11800H 跑得高( 6500ms vs 4500ms ) |
12
Features OP 看来这个程序测不出什么
M1 MAX 都出来了,跟我差不多。。。 |
14
Jxnujason 2022-04-09 22:53:20 +08:00
还不如娱乐大师来的直观
|
15
Features OP 跟 PHP 版本也有关系,我的 PHP 版本是 7.4
大家的 PHP 版本可能稍微低一点 |
17
Xusually 2022-04-09 22:54:25 +08:00
@Features 你这个写入了 800 多 MB 的文本文件,不同的机器的 hdd/ssd 性能差异太大了,没什么可比性。
calc 部分单线程也确实能比较的有限。 |
18
chendy 2022-04-09 22:55:10 +08:00
calc time: 2578.9999961853
all time: 5930.1080703735 m1 16G |
20
juzisang 2022-04-09 22:57:00 +08:00
calc time:2528.5968780518
all time:4155.0738811493% M1Pro 10C32G |
22
ec0 2022-04-09 22:58:40 +08:00 1
这测试的是内存和硬盘吧,和 cpu 关系不大
运行的时候 内存占用 98% 硬盘占用 100% ,系统卡死 calc time:299848.28782082 all time:610035.60996056 |
30
duxiansen 2022-04-09 23:14:31 +08:00
calc time:3997.4188804626
all time:6382.8439712524 PC:i7-9700k+32g calc time:2432.1401119232 all time:4424.0410327911 mbp:m1pro+16g |
31
Mac 2022-04-09 23:27:41 +08:00
calc time:2747.8239536285
all time:4360.5968952179 12700KF DDR4 3200 |
32
zhangjinghua 2022-04-09 23:38:08 +08:00
嗯,根本跑不动,直接报错了
|
34
Features OP @zhangjinghua 可能内存太小了,调大一点 swap 应该可以跑
要占用 4g 以上 |
35
Mac 2022-04-09 23:44:47 +08:00
|
37
zxw567 2022-04-09 23:57:35 +08:00
我感觉我这是个假的 12 代
└ $ php .\ip.php calc time:3925.6041049957 all time:6053.2119274139 |
39
dcty 2022-04-10 00:00:33 +08:00
|
41
Features OP 我自己的 dell 笔记本:
i5 10210U 20g/512G ssd calc time:4852.4708747864 all time:8502.7868747711 |
42
Features OP 台式机 r5 2600 16G/320g SATA SSD
calc time:117811.52701378 all time:389669.60310936 再也不买 AMD 了 |
43
pcmid 2022-04-10 00:21:03 +08:00
calc time:3869.6520328522
all time:5615.1371002197 |
45
secondwtq 2022-04-10 01:44:47 +08:00
你这个把 array 的空间在一开始用 array_fill 就分配好可以快不少
虽然这样还是要花上很长时间分配(很可能比后面的 loop 还长),可能是一堆 page fault 导致的。 另外建议把 implode 和写入分开算时间,写入阶段在同样的机器上能差出一两秒 |
46
Features OP @secondwtq 现在已经占用超过 4G 以上内存了,array_fill 我没用过,不过应该也会占挺多吧?
对哦,implode 应该也是需要一点时间 |
48
lasfresas 2022-04-10 09:43:18 +08:00
calc time:4531.6250324249 all time:7093.4460163116
PHP 8.0.10 cpu: AMD Ryzen 7 5800H |
49
0x20H 2022-04-10 09:48:12 +08:00
calc time:4588.6249542236
all time:9924.3159294128 MacBook Pro (16-inch, 2019). 2.6 GHz 六核 Intel Core i7 |
50
nomedia 2022-04-10 10:13:46 +08:00
calc time:5838.8249874115
write time:691.69592857361 all time:6530.5600166321% I7 8700K 32G RAM PHP 8.0.17 |
51
stormer 2022-04-10 10:23:53 +08:00
calc time:7154.4790267944
write time:935.92810630798 all time:8090.8138751984 i9-10980XE 128G RAM php 8.1.4 |
52
lscho 2022-04-10 10:48:44 +08:00
calc time:2640.949010849
all time:4873.9960193634 M1 Mac mini |
53
jfcherng 2022-04-10 11:00:14 +08:00
@secondwtq #45 要搞 micro optimization 的話... array_push($arr, $val) 改 $arr[] = $val; 少了 function call 就能快上不少,畢竟只在做這件事情...
|
54
C603H6r18Q1mSP9N 2022-04-10 11:12:47 +08:00
calc time:3922.7759838104
all time:8289.7439002991% MacBook Pro (15-inch, 2018) 2.2 GHz 六核 Intel Core i7 16 GB 2400 MHz DDR4 ============ calc time:15584.703922272 all time:31058.578968048 阿里云 8C16G |
55
MeetTheFuture 2022-04-10 11:20:45 +08:00
calc time:4998.4979629517
all time:15482.745885849% MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports) 2.3 GHz 四核 Intel Core i5 8 GB 2133 MHz LPDDR3 |
56
iicoder 2022-04-10 12:13:20 +08:00
calc time:2362.5390529633
all time:3840.1119709015 M1MAX |
57
zqhong 2022-04-10 12:35:21 +08:00
CPU:i9-10850k
开启 xdebug 扩展: calc time:60390.217065811 关闭 xdebug 扩展: calc time:4967.4339294434 去掉一些没用扩展测试准确一些。 |
58
zqhong 2022-04-10 12:42:06 +08:00
php --no-php-ini ip.php
-n --no-php-ini Ignore php.ini completely. 忽略掉自定义的配置,会准确一些 |
59
zqhong 2022-04-10 12:49:24 +08:00
#53
@jfcherng 改了快上很多。 array_push($ipArr,$i); calc time:4966.3610458374 $ipArr[] = $i; calc time:2275.9618759155 |
60
Dart 2022-04-10 12:53:25 +08:00
有病毒你们傻吗
|
61
encro 2022-04-10 13:01:21 +08:00
只能利用单核!!
毫无意义 |
63
qwq11 2022-04-10 13:10:26 +08:00 1
calc time:6886.6419792175
write time:2112.0090484619 all time:8998.97813797 谢谢,从来没感觉自己电脑这么垃圾过 Ryzen 7 3700X @ 3.6 GHz |
66
kingjpa 2022-04-10 14:32:55 +08:00
4 代 i7 4790k + 24g 内存+php7.3
calc time:6624.15599823 all time:21778.345108032 看来 4 代宝刀未老啊 |
67
hsfzxjy 2022-04-10 14:57:15 +08:00
calc time:7752.4108886719
write time:676.14006996155 all time:8428.5979270935 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz 太拉了 |
68
encro 2022-04-10 15:04:45 +08:00
$ipArr= range(0,$max) 不到 1S
|
69
learningman 2022-04-10 15:45:01 +08:00
calc time:32806.836128235
all time:38877.583026886 r7-4800H |
70
liuzhaowei55 2022-04-10 15:56:19 +08:00
calc time:9647.6719379425
write time:495.3351020813 all time:10151.386022568 MBP 17 i7 |
71
yahon 2022-04-10 16:01:23 +08:00
calc time:5541.2330627441
write time:750.66804885864 all time:6292.5171852112 处理器:12th Gen Intel(R) Core(TM) i5-12400 2.50 GHz |
72
yahon 2022-04-10 16:03:10 +08:00
16G 内存
PHP 7.4.26 |
76
Features OP 其实这个程序还是有点用的,上面发的
对有需要托管自有 PHP 服务器的人来说 最好选用新款 Intel CPU ,这样 calc 时间会大大缩短 |
77
yEhwG10ZJa83067x 2022-04-10 16:28:49 +08:00
calc time:9163.7020111084
write time:1329.2951583862 all time:10493.273973465 32G 内存 2400G cpu PHP 7.3.11 |
78
dmitsc 2022-04-10 16:31:56 +08:00
calc time:6131.1450004578 write time:104.05707359314 all time:6235.2271080017
ARM...... |
79
Rache1 2022-04-10 16:36:53 +08:00
😂 放在 SN750 上面,888ms 就可以了。2700X + 32G 2666 频率的 D4 内存条。
calc time:7894.1259384155 write time:888.93294334412 all time:8783.9229106903 把 array_push 换成 [] 语法,calc 仅需要 5000ms. calc time:4968.6708450317 write time:865.20195007324 all time:5834.743976593 如果使用 array_fill 提前分配,可以在上面的基础上再减少 300 ~ 500ms 。 |
80
Lirika 2022-04-10 16:54:36 +08:00
calc time:2447.9248523712
all time:4018.8958644867% m1 pro 14 丐版 cpu ,32G |
81
hervey0424 2022-04-10 16:59:03 +08:00
calc time:4502.0608901978
all time:11407.759904861 |
82
jeffw 2022-04-10 17:50:10 +08:00
calc time:5466.1450386047
all time:10025.525093079 |
83
lxcForPHP 2022-04-10 18:37:30 +08:00
calc time:3843.309879303
all time:6367.2878742218 AMD4800H 32G |
84
haoliang 2022-04-10 18:49:08 +08:00
generator, buffered io, mmap 一个都没用上,开篇就要求 8G 内存上限
|
85
yannxia 2022-04-10 18:53:31 +08:00
calc time:3261.0790729523
all time:5479.4991016388 AMD® Ryzen 9 5900x 64G |
86
skyfix 2022-04-10 19:27:32 +08:00
calc time:3939.5830631256 all time:6724.6930599213
AMD 5800X,32G |
87
Steps 2022-04-10 19:44:12 +08:00
calc time:5807.119846344
write time:227.92196273804 all time:6035.1519584656% Apple M1 Pro |
88
muhuan 2022-04-10 20:23:19 +08:00
calc time:5107.4190139771
all time:11993.241071701 MacMini 2020 i7 |
89
hope4tomorrow 2022-04-10 20:54:51 +08:00
calc time:5888.8449668884
all time:8813.6730194092 CPU aarch64 24G 内存 150G 机械硬盘 |
90
Hurriance 2022-04-10 21:56:58 +08:00
calc time:11680.121183395
write time:1007.7757835388 all time:12688.145160675% |
91
Hurriance 2022-04-10 21:57:37 +08:00
MacBook Pro (Retina, 15-inch, Mid 2015)
|
92
Hurriance 2022-04-10 21:58:18 +08:00
2.2 GHz 四核 Intel Core i7 (不小心直接回复出去了 :D )
|
94
cwcc 2022-04-11 01:46:54 +08:00
2020 年中的 13 寸 intel MBP ( 16G 10gen-i5 )
calc time:4708.4519863129 all time:10341.204881668 AMD Ryzen 5600G ,用 Hyper-V 装的 Ubuntu calc time:3392.725944519 all time:5450.3109455109 |
95
cwcc 2022-04-11 01:48:40 +08:00
ip2 的测试:
|
96
cwcc 2022-04-11 01:49:03 +08:00
AMD:
calc time:5046.4730262756 write time:665.90309143066 all time:5712.4609947205 mbp: calc time:9904.6189785004 write time:334.36608314514 all time:10239.08996582 |
97
cwcc 2022-04-11 01:50:27 +08:00
上面数据反应的我两台电脑性能差距确实很接近,mbp 硬盘更强,amd 的 CPU 更强,但是多核还是没法测到。
|
98
Ch3n4y 2022-04-11 09:29:48 +08:00
M1 MAX 32G.
calc time:2448.1270313263. all time:3989.186048507. |
99
Magician 2022-04-11 09:47:36 +08:00
calc time:19949.950933456
all time:30688.013076782 macbookpro 2015 |
100
FakerLeung 2022-04-11 09:48:16 +08:00
I7 8700, 32G
ip.php calc time:3781.6679477692 all time:24138.736009598 ip2.php calc time:6127.002954483 write time:17389.429092407 all time:23516.4539814 |