A Google engineer has proposed increasing the frequency of timer interrupts in the kernel. Linux Up to 1000 Hz by default, which will increase the task switching frequency and reduce the time slice in the task scheduler. Currently, the default is 250 Hz, which serves as a compromise between performance, latency, and power consumption.
When using displays with a refresh rate of 120Hz, typical for modern PCs and mobile devices, at a timer frequency of 250Hz, the time slicing inaccuracy is approximately half the frame time, which reduces the efficiency of resource allocation and does not allow achieving an optimal performance-to-power ratio. Power consumption of systems with a low timer frequency may be higher, since the DVFS (Dynamic Voltage and Frequency Scaling) mechanism uses a more aggressive frequency selection strategy in order not to slow down tasks.
There are situations when a task has already completed the desired operations that required active calculations, but the processor continues to operate at an increased frequency due to the finiteness of the time quantum that has not yet ended. Increasing the task switching frequency can lead to a decrease in energy consumption due to the increased efficiency of dynamic frequency management (DVFS), more accurate distribution of intervals by the task scheduler, more frequent updating of CPU load statistics, and a decrease in the time that tasks spend in the waiting state.
Another Google engineer suggested leaving the timer frequency as is (250 Hz), as increasing the timer interrupt frequency could lead to increased power consumption on low-power devices, such as IoT boards. He estimated that setting the frequency to 1000 Hz, even on devices running Android In some situations, an increase in processor power consumption of up to 7% was observed. Increasing the timer frequency also results in more frequent CPU wakeups, since at 250 Hz, timers set to intervals of t + 1 ms, t + 2 ms, t + 3 ms, and t + 4 ms will be grouped and result in a single wakeup, while at 1000 Hz, four separate wakeups will occur.
The Phoronix resource compared the performance of a PC based on the AMD Ryzen 9 9950X CPU. The 1000Hz configuration turned out to be faster in the Llama.cpp, nginx, SuperTuxKart, Selenium tests and when measuring the kernel build time. In the Darktable, PostgreSQL, Unvanquished, Xonotic, Blender, SVT-AV1, RawTherapee tests, the performance was higher when setting 250Hz. At 1000Hz, the average power consumption was 144.2 W, the minimum was 0.18 W, the maximum was 202.13 W, and at 250Hz: average 144.37 W, minimum 0.07 W, maximum 202 W.

Source: opennet.ru
