cpu

What is a cache hit and a cache miss? Why would context-switching cause cache miss?

别来无恙 提交于 2019-11-29 20:07:53
From the 11th Chapter( Performance and Scalability ) and the section named Context Switching of the JCIP book : When a new thread is switched in, the data it needs is unlikely to be in the local processor cache, so a context-switch causes a flurry of cache misses, and thus threads run a little more slowly when they are first scheduled. Can someone explain in an easy to understand way the concept of cache miss and its probable opposite ( cache hit )? Why context-switching would cause a lot of cache miss? Can someone explain in an easy to understand way the concept of cache miss and its probable

c# Environment.ProcessorCount does not always return the full number of Logical Processor, why?

时光毁灭记忆、已成空白 提交于 2019-11-29 19:05:44
问题 On my machine, windows 7 - Enterprise with 1 x Intel Xeon E5-1660 0 @ 3.30Ghz (6 cores/cpu with Hyper Threading activated), Environment.ProcessorCount return 12 which is exact. On a Windows Server 2012 with 2 x Intel Xeon E5-2697 v3 @ 2.60GHz (14 cores/cpu with Hyper Threading activated(I think because task manager show: 2 sockets, 28 cores, 56 logical processors)), Environment.ProcessorCount return 28 which appears to us as wrong because 2x14x2 = 56. Why on Windows Server 2012 c# method

How can I test the user's computer's processing power using Javascript?

做~自己de王妃 提交于 2019-11-29 18:54:00
问题 I made a pretty CPU intensive webpage with lots of CSS3 and Javascript. I want to use Javascript to test if the user's computer is capable of handling the scripts. I think a possible method is to run some CPU intensive scripts and see how long it took. However, I don't know how to actually implement this. Here's the webpage: http://leojiang.me/ (3D cube only viewable in webkit browsers). 回答1: You can profile how long it takes to render a frame or a couple of frames that should give you and

The difference between Call Gate, Interrupt Gate, Trap Gate?

萝らか妹 提交于 2019-11-29 18:52:47
I am studying Intel Protected Mode. I found that Call Gate, Interrupt Gate, Trap Gate are almost the same. In fact, besides that Call Gate has the fields for parameter counter, and that these 3 gates have different type fields, they are identical in all other fields. As to their functions, they are all used to transfer code control into some procedure within some code segment. I am wondering, since these 3 gates all contain the information needed for the call across privilege boundaries. Why do we need 3 kinds of them? Isn't 1 just good enough? Thanks for your time and response. Update 1 A

generate CPU load in Java

自闭症网瘾萝莉.ら 提交于 2019-11-29 18:20:00
问题 I am conducting some throughput testing. My application has to read from JMS do some processing write to JMS My goal here is to simulate #2, 'some processing'. That is, introduce a delay and occupy the CPU for a given time (e.g. 500ms) before forwarding the event. The naive approach would be to Thread.sleep(500) . This would introduce the right delay in execution, but would not exercise the CPU. Calculating Fibonacci numbers is one option. Has anyone used any interesting techniques just to

interpreting dumpsys cpuinfo

ぐ巨炮叔叔 提交于 2019-11-29 16:10:06
问题 Im looking for an explanation of result of command "dumpsys cpuinfo" in android shell. :# dumpsys cpuinfo Load: 17.78 / 16.97 / 16.29 CPU usage from 35983ms to 21604ms ago: 97% 25268/com.firstprocess: 78% user + 19% kernel / faults: 19938 minor 36% 25680/com.secondprocess: 19% user + 17% kernel / faults: 950 minor 11% 25151/com.anotherprocess: 8.8% user + 2.4% kernel / faults: 13794 minor 6 major 18% 739/system_server: 13% user + 5.4% kernel / faults: 3803 minor 2 major 14% 1242/android

Python multithreading max_workers

早过忘川 提交于 2019-11-29 15:28:48
According to the documentation of ThreadPoolExecutor If max_workers is None or not given, it will default to the number of processors on the machine. If I don't set it a value like this ThreadPoolExecutor(max_workers=None) is it bad for performance in case that my value is very low (2) ? Will python already allocate all the CPU processes for None value vs allocate only 2 for value with a number? Ami Tavory To begin with, you seem to be quoting the wrong part of the documentation in your link, namely the one for processes, not threads. The one for concurrent.futures.ThreadPoolExecutor states:

Is there a way to disable CPU cache (L1/L2) on a Linux system?

China☆狼群 提交于 2019-11-29 14:40:54
I am profiling some code on a Linux system (running on Intel Core i7 4500U) to obtain the time of ONLY the execution costs. The application is the demo mpeg2dec from libmpeg2. I am trying to obtain a probability distribution for the mpeg2 execution times. However we want to see the raw execution cost when cache is switched off. Is there a way I can disable the cpu cache of my system via a Linux command, or via a gcc flag ? or even set the cpu (L1/L2) cache size to 0KB ? or even add some code changed to disable cache ? Of course, without modifying or rebuilding the kernel. See this 2012 thread,

Command for finding process using too much CPU [closed]

徘徊边缘 提交于 2019-11-29 14:06:38
问题 What command can I use to find a process that's using a lot of CPU? Can I do this without installing something new? 回答1: Or using a few other utils you could do: ps aux | sort -rk 3,3 | head -n 5 Change the value of head to get the number of processes you want to see. 回答2: Try doing this : top -b -n1 -c And if you want the process that takes the most %CPU times : top -b -n1 -c | awk '/PID *USER/{print;getline;print}' or top -b -n1 -c | grep -A 2 '^$' 来源: https://stackoverflow.com/questions

What is general difference between Superscalar and OoO execution?

帅比萌擦擦* 提交于 2019-11-29 12:25:45
问题 I've been reading some material on superscalr and OoO and I am confused. I think their architecture graphs look very much the same. 回答1: Superscalar microprocessors can execute two or more instructions at the same time. E.g. typically they have at least 2 ALUs (although a superscalar processor might have 1 ALU and some other execution unit, like a shifter or jump unit.) (More precisely, superscalar processors can start executing two or more instructions in the same cycle. Pipelined processors