问题标签 [cpu-speed]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
machine-learning - 如何提高处理器的利用率以加快数据处理速度?
我正在使用三星 NP350V5C-S06IN 笔记本电脑进行机器学习相关的数据处理。规格:(第 3 代 Ci7 (2.3 GHz)/8GB RAM/Win7 HP/2GB AMD Radeon HD 7670M 显卡)
运行像 RF 或 GBM 这样的计算密集型算法需要大量时间 -4 小时到 6 小时。但是,当我在进程通过任务管理器运行时监控系统时,我观察到 8 个内核中的每一个的利用率都非常低,仅在任何给定时刻都只有 15%-20%。有什么办法可以提高每个内核的利用率以加快处理速度?
具体问题:安装Hadoop能否帮助我提高利用率和处理速度?有什么方法可以利用显卡及其 2 GB 内存?
timing - 如何在二进制可执行文件中找到函数的确切运行时间?
对于我的研究,我想比较我的程序 A 和另一个程序 B 的确切运行时间。但是,我没有 B 源代码。该程序由一些必须从运行时排除的预处理和后处理任务组成。
如何仅测量主要功能所需的时间(即,没有预处理和后处理功能)?
该程序非常快,运行时间(由程序本身报告)几乎低于 1 秒。(如果我有源代码,我可以将 main 函数放在一个循环中,以更精确地测量经过的时间)。
我认为可能有一些减速功能(或模拟器)来查找确切的经过时间,但我不确定该方法是否有效。
任何测量功能的想法都值得赞赏。
(平台:Fedora 17,很可能程序是用 gcc 编译的,带有 /O3 进行优化)。
c - 如何在 Windows/Linux C 上检查 CPU 名称、型号、速度?
我想用 C 获得一些关于硬件的信息:
- 我有多少个 CPU
- 每个有多少个核心
- 每个 CPU 中每个核心有多少个逻辑核心
- CPU名称+型号
- CPU速度+频率
- CPU 架构(x86、x64)
我知道在类似 Linux 的操作系统上我可以解析/proc/cpuinfo
,但由于它不是普通文件,我认为它不安全。在 SO 上看到了这个答案,但它并没有给我我需要的所有信息。我应该打电话cat /proc/cpuinfo > file.txt
然后解析file.txt
吗?我知道cpuid.h
(我正在使用 GCC),但找不到任何关于此标头的文档(无论如何 - 使用它是个好主意吗?)
c# - 比较两台机器的可用处理能力
考虑一个负载均衡器,它根据其单元的可用(剩余)处理能力来平衡负载。您将如何计算此参数以进行比较?
我正在尝试实现这一点,C#
到目前为止,我可以查询CPU
百分比的使用情况,但这并不适用,因为不同的机器可能使用不同的处理器。也许如果我能找出每台机器的处理能力乘以它的空闲CPU
百分比,这将是一个很好的估计。
但是处理器的重要参数是什么,以及如何将它们聚合成一个数字?
windows-8 - 如何在 Windows 8 中检查我的 CPU 缓存?
我有一个问题:我在 Windows 8 中找不到任何可以显示我的 CPU 缓存的面板或命令?
有一些软件可以获取sysconfig。但这些不是完整的信息。它完全是除 CPU_CACHE 之外的所有信息。
performance - 如何得出 Intel Xeon E5-2690 的 GFlop/s 的峰值性能?
在此处理器比较中,我能够找到 Xeon E5-2690 的理论 DP 峰值性能 371 GFlop/s (有趣的是,在英特尔的竞争对手中找到此信息比在英特尔支持页面本身更容易)。但是,当我尝试推导该峰值性能时,我的推导不匹配:
- Xeon E5-2690 的每个核心的频率(在 Turbo 模式下)= 3.8Ghz
- 处理器可以在每个周期执行一次
add
和mul
操作,因此我们得到:3.8 x 2 = 7.6 - 鉴于它支持 AVX,它每个周期可以执行 4 次双重操作:7.6 x 4 = 30.4
- 最后,它有 8 个内核,因此我们得到:8 x 30.4 = 243.2
因此,Gflop/s 的峰值性能将是 243.2 GFlop/s 而不是 371 GFlop/s?
c++ - 在 XCODE 5 中将 CPU 利用率提高到 100% 以上
我在 XCODE 5 中运行一个简单的基于控制台的 C++ 应用程序。
我有一个 2.8GHZ 英特尔酷睿 i7 处理器。如果我查看 CPU 利用率,以下是统计信息:
是否可以将免费的 537% 用于 My_Program ?是否可以在 XCODE 或 Eclipse 中将 CPU 利用率提高 > 100%?
谢谢,任何建议表示赞赏。
c++ - How to understand the tricky speed up
Sorry for may be too abstract question, but for me it is quite practical + may be some experts had similar experience and can explain it.
I have a big code, about 10000 lines size.
I notices that if in a certain place I put
where expression is always false (double checked with logic of code and cout), but depends on unknown parameters (so compiler can't simply rid of this line during compilation) the speed of the program is increased by 25% (the result of calculation are the same). If I measure speed of the loop itself the speed up factor is bigger than 3.
Why can this happen and what is possible ways to use this speed up possibility without such tricks?
P.S. I use gcc 4.7.3, -O3 optimisation.
More info:
I have tried two different expressions, both works.
If I change the line to:
the speed up is gone.
If I change the line to:
the speed up is gone.
The code, which surrounds the line looks like this:
the for loop looks strange. It is because I have modified the loops in order to catch this bottle neck. Initially expression was equal to expression0 and instead of do-loop I had only this continue.
I tried use __builtin_expect in order to understand branch prediction. With
the speed up is 25%.
the speed up is gone.
If I use -O2 instead of -O3 the effect is gone. The code is slightly (~3%) slower than the fast O3-version with the false condition.
Same for "-O2 -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize". With one more option: "-O2 -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fipa-cp-clone" the effect is amplified. With "the line" the speed is same, without "the line" the code is 75% slower.
The reason is in just following conditional operator. So the code looks like this:
The value of expression2 is almost always false. So I changed it like this:
And have got desired 25% speed up. Even a little bit more. And behaviour no longer depends on the critical line.
If somebody knows materials, which can explain this behaviour without guesses I will be very glad to read and accept their answer.
android - 尽管 USB 断开时有唤醒锁,但 Android 应用程序速度变慢
我正在制作一个执行一些音频处理并实时播放的应用程序。我面临的问题是,当手机通过 USB 电缆连接到计算机时,应用程序工作得很好,但是当电缆断开时,音频开始跳过并弹出。在断开电缆的情况下,如果我打开屏幕,则应用程序会恢复正常行为,但一旦屏幕关闭,就会再次出现问题。
对我来说,这听起来像是 CPU 进入省电模式并在连接 USB 电缆或屏幕打开时保持唤醒状态,所以我尝试通过获取PARTIAL_WAKE_LOCK
. 然而,这并没有解决问题。
有人可以告诉我可能是什么问题吗?我很确定我的唤醒锁代码没问题。有没有办法诊断 CPU 是否要休眠?
保持屏幕打开对我来说不是一个选择。
arm - 当我降低 CPU 的时钟频率时,中断延迟(或中断延迟中的抖动)会发生什么
我有一个在 ARM cpu 上运行的裸机程序,它正在处理实时应用程序的中断。功率也是一个限制因素,所以我正在考虑使用该特定 CPU 的频率。有没有一种方法可以预测我在更改频率时可以预期的变化(中断延迟或中断延迟中的抖动)。我知道我可以通过实现它并测量它来手动执行此操作,但我想知道是否有逻辑或数学方法可以做到这一点。
谢谢。
问候,N