CPU speed determines how fast your process can perform tasks. CPU speeds matter less than they did in the past, thanks to the advent of multi-core processors.
Questions tagged [cpu-speed]
203 questions
75
votes
10 answers
Is the inequality operator faster than the equality operator?
I know this is a micro-optimization, so I ask out of pure curiosity.
Logically, a microprocessor does not need to compare all the bits of both operands of an equality operator in order to determine a "FALSE" result.
Note, this is…

Mackenzie
- 1,897
- 1
- 19
- 25
37
votes
6 answers
Finding out the CPU clock frequency (per core, per processor)
Programs like CPUz are very good at giving in depth information about the system (bus speed, memory timings, etc.)
However, is there a programmatic way of calculating the per core (and per processor, in multi processor systems with multiple cores…

kidoman
- 2,402
- 5
- 26
- 35
25
votes
4 answers
How to detect android cpu speed?
I would like to detect how fast is the device on which my Android application is running?
Is there any API to do it on Android? Or do I have to benchmark it by myself?
If the device has slow CPU I would like to turn off some time consuming…

Dariusz Bacinski
- 8,324
- 9
- 38
- 47
25
votes
0 answers
Windows: Disabling CPU idle C-states from kernel-mode driver
I'm writing an audio device driver which needs to process device interrupts in real-time. When the CPU enters C3 state, interrupts are delayed, causing problems to the driver. Is there a way for the driver to tell the OS not to enter idle…

Svetoslav Ilkov Enchev
- 371
- 3
- 6
23
votes
1 answer
Why is modulus operator slow?
Paraphrasing from in "Programming Pearls" book (about c language on older machines, since book is from the late 90's):
Integer arithmetic operations (+, -, *) can take around 10 nano seconds whereas the % operator takes up to 100 nano seconds.
Why…

AV94
- 1,824
- 3
- 23
- 36
21
votes
5 answers
Detect current CPU Clock Speed Programmatically on OS X?
I just bought a nifty MBA 13" Core i7. I'm told the CPU speed varies automatically, and pretty wildly, too. I'd really like to be able to monitor this with a simple app.
Are there any Cocoa or C calls to find the current clock speed, without…

Tim
- 14,447
- 6
- 40
- 63
21
votes
7 answers
Does Android Studio Performance Scale Well With Number Of CPU Cores
for example AMD Ryzen 5 1600 has 6 (2 logical cores per physical) cores with Clockspeed: 3.2 GHz Turbo Speed: 3.6 GHz .
In contrast, Intel Core i5-7600 has 4 cores with Clockspeed: 3.5 GHz
Turbo Speed: 4.1 GHz.
My exprience, Ryzen 1600 perform litle…

Kamal Mrock
- 374
- 1
- 2
- 13
20
votes
15 answers
Exactly how "fast" are modern CPUs?
When I used to program embedded systems and early 8/16-bit PCs (6502, 68K, 8086) I had a pretty good handle on exacly how long (in nanoseconds or microseconds) each instruction took to execute. Depending on family, one (or four) cycles equated to…

Roddy
- 66,617
- 42
- 165
- 277
19
votes
1 answer
Android game loop, how to control speed and frame rate
I've written a game for Android, and I've tested it on the Dev Phone 1. It works perfectly, the speed is just right. However, I'm sure phone CPU's are getting faster. They may already be faster than the dev phone.
How do I make sure that my game…

Ben Mc
- 2,038
- 6
- 30
- 37
19
votes
5 answers
How can I programmatically find the CPU frequency with C
I'm trying to find out if there is anyway to get an idea of the CPU frequency of the system my C code is running on.
To clarify, I'm looking for an abstract solution, (one that will not be tied to a specific architecture or OS) which can give me an…

Mike
- 47,263
- 29
- 113
- 177
16
votes
2 answers
How to compute the theoretical peak performance of CPU
Here is my cat /proc/cpuinfo output:
...
processor : 15
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Xeon(R) CPU E5520 @ 2.27GHz
stepping : 5
cpu…

user435657
- 625
- 2
- 10
- 28
16
votes
1 answer
Why can't my ultraportable laptop CPU maintain peak performance in HPC
I have developed a high performance Cholesky factorization routine, which should have peak performance at around 10.5 GFLOPs on a single CPU (without hyperthreading). But there is some phenomenon which I don't understand when I test its performance.…

Zheyuan Li
- 71,365
- 17
- 180
- 248
15
votes
2 answers
How to keep CPU from 'sleeping' when screen is turned off in Android?
I have an application in which I am sending network data over WiFI. Everything is fine until I turn the display off or the device goes to 'sleep'. I'm already locking the WiFi however, it seems to be the case that the CPU speed ramps down when in…

fatfreddyscat
- 835
- 3
- 8
- 26
13
votes
3 answers
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
if ( expression )…

klm123
- 12,105
- 14
- 57
- 95
13
votes
2 answers
Does multi-threading improve performance? How?
I hear everyone talking about how multi-threading can improve performance. I don't believe this, unless there is something I'm missing. If I have an array of 100 elements and traversing it takes 6 seconds. When I divide the work between two threads,…

Valentin
- 654
- 2
- 7
- 15