Is there any use to let the process "warm up"?

Recently, I worked a little in memory and how to use it correctly. Of course, I also came across prefetching and how I can make life easier for the processor.

I did some tests to see the actual benefits of properly storing / accessing data and instructions. These tests showed not only the expected benefits associated with supporting processor prefetching, but also showed that prefetching also speeds up the process at run time. After about 100 program cycles, the processor seems to have computed it and optimized the cache accordingly. This saves me up to 200,000 ticks per cycle, the number drops from 750,000 to 550,000. I got these numbers using qTestLib.

Now to the question: is there a safe way to use this acceleration at run time, allowing it to warm up, so to speak? Or should it not be computed at all and just create faster code from the moment it is launched?

+6
source share
2 answers

First of all, it usually does not work out to intensify the attempt to warm up the process to normal execution: this will only speed up the first 100 program cycles in your case, receiving a total of less than 20,000 ticks. This is much less than the 75,000 ticks that you have to invest in warming up.

Secondly, all of these benefits from warming up the process / cache / are somewhat fragile. There are a number of events that destroy the warming effect, which you usually do not control. This is mainly due to the fact that your process is not alone in the system. A process switch can behave just like an asynchronous cache flash, and whenever a kernel needs a memory page, it can remove a page from the disk cache.

Since factors make the computation time rather unpredictable, they need to be controlled when performing tests that should give results of any reliability. In addition, these effects are mostly ignored.

+5
source

It is important to note that keeping a busy processor is not necessarily a bad thing. Ideally, you want your processor to run from 60% to 100%, because it means that your computer is actually doing the “job”. Of course, if there is a process that you do not know about, and this process takes CPU cycles, this is not good.

In response to your question, the machine usually takes care of this.

-2
source

All Articles