4 ms·
From the screenshot of the Intel documented linked: The increased latency ... has a small positive performance impact of 1-2% on highly threaded applications.
by userbinator 8y ago
From the screenshot of the Intel documented linked:
The increased latency ... has a small positive performance impact of 1-2% on highly threaded applications.
Making an instruction more than 10x slower overall, for a 1-2% gain (who wants to bet it's some "industry standard" benchmark...?) in a very specific situation sounds like a textbook example of premature microoptimisation. Of course they don't want to give the impression that they severely slowed things down, but the wording of the last sentence is quite amusing: "some performance loss"? More like "a lot". It reminds me of what they said about the Spectre/Meltdown workarounds.
- zaarn 8y agoOn the other hand, if 99% of highly threaded applications run 1% faster and 1% of applications run 10 times slower, maybe it's worth it? Maybe?? Tbh I think this is more of a sign that Intel's architecture, the Core i generation of CPUs, has been optimized as much as you reasonably can and Intel is squeezing out a few more cpu cycles here and there.
- ethbro 8y agoOne of the dark arts of chip design is getting a pulse on existing code in the wild, and evaluating potential microarch changes against it. Someone else can pipe in, but the impression I got from friends in that industry was that Intel had a fairly advanced org set up to evaluate that. Or to look at it another way, they didn't want to make an $x billion bet without due diligence.
- smaddox 8y agoThat's what happens when you let simple metrics dictate engineering decisions (and career advancement).
- dpark 8y agoHighly threaded applications are not “a very specific situation”. This is a huge class of important applications. This describes most popular services. It’s not “premature optimization” to gain 1-2% for likely trillions of application executions.
- ajross 8y agoNo, because the only use of the instruction is to fix a latency "bug" on spin loop exit. PAUSE (which is actually encoded as "REP NOP" -- the instruction itself is sort of a backronym) exists as a hint to the processor that the loop exit will be speculated wrong, so predict it the opposite way. If you are spending even a tiny fraction of 1% of your time spinning, your app has terrible performance bugs already. This article is just bad analysis.
- the8472 8y ago> If you are spending even a tiny fraction of 1% of your time spinning, your app has terrible performance bugs already. Not necessarily. Very latency-sensitive applications may pin a thread to a CPU core and mark the core as reserved so the kernel doesn't schedule any other task or interrupt on it. Busy-waiting is used instead of yielding to the scheduler, that way context switches can be avoided almost entirely.
- ajross 8y agoI guess. Normal RTOS applications with needs like that just do the work in an ISR. But sure, granted. Those aren't applications that are going to be running on Skylake though. The bottom line is that this is an architecture optimized for compute throughput, and they figured out that if they spent a few cycles on spin exit they could more than make it back via more effective hyperthread dispatch. And for everyone but .NET, that seems to be the case.
- cjhanks 8y agoWhy would latency sensitive applications (let's say a millisecond of jitter) be using .NET and its runtime? I thought the VM class of languages were generally inappropriate for real-time work. Heck, even in C, you need to do specific work on the memory allocator to make real-time viable.
- kllrnohj 8y ago> a textbook example of premature microoptimisation No, this is textbook optimization Benchmarks showed a positive gain -> that's a real optimization, not premature at all. Premature optimization is when you guess than a change will make things better without measuring. As soon as you measure it becomes real optimization work, not premature at all. As in, this is how you're supposed to make things better. Feel free to debate the merits of their benchmarkmark, but this is a textbook example of Doing Performance Correctly otherwise.
- codedokode 8y ago> Benchmarks showed a positive gain But this gain of 1-2% is balanced with author's 50% performance loss. I guess it means that the benchmark results here depend on choice of tested applications. If they had used more multithread .NET applications, the tests could show a performance degradation as well.