SN-2358 已核对来源,附原文与上下文。
其他参与者原话tcatm原帖 ↗我建议用 -O3 -march=amdfamk10 编译 sha256.cpp(32 位和 64 位都能用),因为只有支持这套指令集的 CPU(AMD Phenom、Intel i5 及更新)才能从 -4way 受益,而且能带来约 9% 的性能提升。
I propose to compile sha256.cpp with -O3 -march=amdfamk10 (will work on 32bit and 64bit) as only CPUs supporting this instruction set (AMD Phenom, Intel i5 and newer) benefit from -4way and it'll improve performance by ~9%.
GCC 4.3.3 不支持 -march=amdfamk10。我得到:
GCC 4.3.3 doesn't support -march=amdfamk10. I get:
sha256.cpp:1: error: bad value (amdfamk10) for -march= switch
sha256.cpp:1: error: bad value (amdfamk10) for -march= switch
其他参与者原话NewLibertyStandard原帖 ↗用 4way 时,启用全部虚拟核心会明显更好。我觉得超线程关闭时,开不开 4way 哈希量差不多。
With 4way, I get significantly better performance when I have all my virtual cores enabled. I think I get about the same amount of hashes when hyper threading is turned off with or without 4way.
嘿,你也许发现了什么!
Hey, you may be onto something!
之前超线程没好处,是因为所有工作都发生在超线程共享的算术逻辑单元里。
hyperthreading didn't help before because all the work was in the arithmetic and logic units, which the hyperthreads share.
tcatm 的 SSE2 代码一定是普通 x86 指令和 SSE2 指令的混合体,这样一个线程跑 x86 代码时,另一个就能跑 SSE2。
tcatm's SSE2 code must be a mix of normal x86 instructions and SSE2 instructions, so while one is doing x86 code, the other can do SSE2.
开超线程你提升了多少?
How much of an improvement do you get with hyperthreading?
给几个数字?那是什么 CPU?
Some numbers? What CPU is that?