高通 CPU 浮点这么快吗。。。

2023-11-24 22:00:19 +08:00
 lwjef
wget https://github.com/xiexiexx/PPLA/raw/main/billionsort/billionsort.cpp

clang++ -O3 billionsort.cpp

./a.out

有没有 8gen3 和 9300 的老哥跑一下让我长长见识

[Documents]$ ./1x_millionsort_with_output 100
Data size: 100000000
0.0027 minutes
0.02695 minutes
0.478667 minutes

9903 次点击
所在节点    程序员
67 条回复
pubby
2023-11-24 22:34:14 +08:00
$ uname -a
Darwin Mac-mini.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Oct 4 21:25:26 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_X86_64 x86_64
$ sysctl machdep.cpu.brand_string
machdep.cpu.brand_string: Intel(R) Core(TM) i9-9900T CPU @ 2.10GHz
$ ./a.out
0.0942143 minutes
0.277907 minutes
2.31389 minutes
lwjef
2023-11-24 22:39:03 +08:00
@pubby #1 这个 i9 也太慢了。。。
pubby
2023-11-24 22:41:46 +08:00
@lwjef 低压 u, 内存频率也不高 :D
kikitte
2023-11-24 22:54:26 +08:00
AMD 5950x ArchLinux

[kikitte@archlinux test]$ clang++ -O3 billionsort.cpp
[kikitte@archlinux test]$ ./a.out
0.0128345 minutes
0.954518 minutes
1.46679 minutes
hefish
2023-11-24 23:03:18 +08:00
这个 sort 也跟 cpu 线程数有关吧
maggch97
2023-11-24 23:05:04 +08:00
首先这个 sort 是单线程的
lslqtz
2023-11-24 23:07:53 +08:00
M1 Pro 感觉差不多.
这是单核浮点吧.
lwjef
2023-11-24 23:08:46 +08:00
@maggch97 #6 不是 io 项目单核下多线程也没用吧
lwjef
2023-11-24 23:10:19 +08:00
@lslqtz #7 嗯嗯,就是高通的 fpu 有点离谱
beetlerx
2023-11-24 23:11:40 +08:00
OS: Debian GNU/Linux trixie/sid x86_64
CPU: AMD Ryzen 7 7840H w/ Radeon 780M Graphics (16) @ 5.137GHz

$ clang++-16 -std=c++2a -O3 ./billionsort.cpp
$ ./a.out
0.00709458 minutes
0.757148 minutes
1.45406 minutes
看起来 7840H 单核浮点可以和 5950x 掰掰
Philippa
2023-11-24 23:18:56 +08:00
.., larry@DESKTOP-OVBIJM9
....,,:;+ccllll ---------------------
...,,+:; cllllllllllllllllll OS: Windows 10 רҵ□□ x86_64
,cclllllllllll lllllllllllllllllll Host: ASUS
llllllllllllll lllllllllllllllllll Kernel: 10.0.19045
llllllllllllll lllllllllllllllllll Uptime: 14 hours, 59 mins
llllllllllllll lllllllllllllllllll Packages: 3 (scoop)
llllllllllllll lllllllllllllllllll Shell: bash 5.2.15
llllllllllllll lllllllllllllllllll Resolution: 3840x2160
DE: Aero
llllllllllllll lllllllllllllllllll WM: Explorer
llllllllllllll lllllllllllllllllll WM Theme: Custom
llllllllllllll lllllllllllllllllll Terminal: Windows Terminal
llllllllllllll lllllllllllllllllll CPU: AMD Ryzen 9 7950X3D (32) @ 4.200GHz
llllllllllllll lllllllllllllllllll GPU: Caption
`'ccllllllllll lllllllllllllllllll GPU: NVIDIA GeForce RTX 4090
`' \*:: :ccllllllllllllllll GPU
````''*::cll Memory: 16818MiB / 130802MiB
``

clang++ -std=c++2a -O3 main.cpp

0.0153925 minutes
0.683383 minutes
1.30065 minutes

不是很懂,为什么这么慢
lwjef
2023-11-24 23:21:30 +08:00
@Philippa #11 还有 15 个核在围观 QAQ
Philippa
2023-11-24 23:22:15 +08:00
@lwjef 哈哈哈,那要怎么设
maggch97
2023-11-24 23:23:12 +08:00
@lwjef ? 我不知道你是不是了解 CPU 性能,了解代码。

你这个代码只能测出 CPU 跑 std::sort 这样的单线程负载的性能,速度受到 Memory, Cache 的影响
lwjef
2023-11-24 23:25:26 +08:00
@maggch97 #14 那么是高通不够快吗 (狗头
maggch97
2023-11-24 23:27:37 +08:00
这能叫做"浮点性能"吗,下面的回帖很多人也被误导了
lwjef
2023-11-24 23:28:57 +08:00
@Philippa #13 就是跑的一个核,已经是贴子里 x86 最快的了
lwjef
2023-11-24 23:29:33 +08:00
@maggch97 #16 那为啥高通这么快啊,请教下。。。
Philippa
2023-11-24 23:30:29 +08:00
@lwjef 感谢科普
bigtan
2023-11-24 23:31:08 +08:00
我这个 14700KF 怎么这么慢

0.0179123 minutes
0.263897 minutes
3.26288 minutes

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/994966

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX