Answer the question
In order to leave comments, you need to log in
Dynamically getting the speed of the processor?
Interested in a cross-platform solution ideally. Is there a way to get the current processor speed?
Answer the question
In order to leave comments, you need to log in
Vadim Ushakov , You see, your question is absurd in a certain sense, because you want to literally "measure who knows what is not known how."
You can try to specify, for example, saying that the core frequency is to be measured.
But the frequency of the processor, although it correlates with how fast it executes instructions, is not strictly related to this. Because the speed of execution of a certain program by a certain processor depends on the frequency, and on the program itself - you can write matrix multiplication as in MKL, with cache alignment and intrisinks, or you can not write it and get a speed drop of 40 times, if not more.
This is when it comes to computing. But now number crushers are a rarity, applications tied to IO are more common - and there the processor can thresh at all its gigahertz - if the thread is sleeping and waiting for data, but will continue to do so, albeit with a huge clock frequency.
What exactly do you mean by "processor speed"?
A modern multi-core multi-threaded processor with cores that can run at a dynamic frequency, in a multitasking operating system, with a different set of hardware optimization algorithms, cannot be measured once or twice.
And considering that modern server software works for the most part in a virtual environment, or even in a container, where resources are allocated again in a virtualized way, and they can cut you 100 virtual cores from a 20-core processor, about which your virtual machine will know not only that under the hood, and what they say to her.
And you want a cross-platform solution?
In the 2021 century, when measuring performance, ask the most detailed question of what exactly you want to measure and why. Because it is already impossible to simply measure EVERYTHING and as accurately as possible.
Not without reason, even the most popular benchmarks, which are used by hundreds of millions, have many different metrics that show different numbers on different processors and are still considered "synthetic", recommending that you test your application with your application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question