超线程性能比较 [英] Hyper-threading Performance Comparison

查看:320
本文介绍了超线程性能比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个项目,它使用 openssl 中的一些基本功能,例如 RAND_bytes des_ecb_encrypt

I have written a project, which uses some basic functions in openssl such as RAND_bytes and des_ecb_encrypt.

我的电脑有i7-2600(4核和8个逻辑CPU)。当我运行我的项目有4个线程,它将花费10秒。当我用8个线程运行它,它也花费10秒。

My computer has i7-2600(4 cores and 8 logic CPU). When I run my project with 4 threads, it will costs 10 seconds. When I run it with 8 threads, it also costs 10 seconds.

我的意思是超线程不给我任何性能改进。在Linux中,实验结果是相同的。

What I mean is that hyper-threading doesn't give me any performance improvement. In Linux, the experiment result is same.

我发现这里告诉我超在某些情况下,线程不会给我一些改进。此外,我在这里找到了这里给我一些直观的结果。

I found here tells me that hyper-threading doesn't give me some improvement in some situations. Also, I found here give me some intuitive results.

然而,我试图写一些简单的测试,并发现一些简单的例子,将显示超线程不会给我明显改善。很遗憾,我找不到。

However, I have tried to write some simple tests and found some simple examples which will show hyper-threading won't give me apparent improvement. Sadly, I don't find it.

所以,我的问题是,是否有一些简单超线程不会给我任何性能改进。

So, my questions is that whether there are some simple tests shows the hyper-threading won't give me any performance improvement.

推荐答案

您可能会发现超线程有助于更多的代码使用大量的内存,这样处理器就会定期从内存中获取内存。

You may find that hyperthreading helps more on code that is using large amounts of memory, so that the processor is regularly blocked on fetching from memory.

根据我的经验,很难找到简单代码,它显示了超线程的好处。它往往是更复杂的例子,显示的好处。然而,好处将很可能不是没有超线程的2倍。计数得到或许20-30%的改善。

In my experience, it's quite hard to find "simple code" that shows benefits from hyperthreading. It tends to be more complex examples that show the benefit. Still, the benefit will most likely not be 2x that of "no hyperthreading". Count on getting perhaps 20-30% improvement.

这篇关于超线程性能比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆