I have to respectfully disagree with you here.
It sheds a wealth of information. Many guys here seem to be using a comparison using the PC and hardware peripherals. That is not what we are talking about here.
Maybe if i try to explain it in a different way it will shed some light on what we are talking about.
Lets take a uP with a hardware SPI port. If i do something like WriteSPI(x) this will tell me nothing about how my code gets interpreted or the speed in which this happens. The code simply loads the value into the SPI register and the uP takes it from there. The uP will shift out the bits on its own and there is no “code” running that does this. so it does not reveal what we are looking for.
What we are talking about is how fast the JIT can perform the most mundane operations. Bit twiddling is of the slowest. when you do it this way you are actually running code line by line to toggle the pin high and low. This will give you a general idea of how fast the slowest operation can be.
Another example or maybe the one i should have used to start with would be comparing compiler A to compiler B. When doing this one would typically do something like this this right off the bat.
Create a while loop, and in that loop you start off by pulling a pin high. then start a for loop say 1 to 10k and in that lop you do some math operations. then pull pin low. Connect your scope to the port pin and see how long it takes compiler A do it, then try it on compiler B. What this will show you is how each compilers generated code will take. Sure, you could look at the assembly and count the cycles, but this is faster. One compilers output will toggle the pin faster than the other. I have done this may times over the years and you would be amazed at how well it weeds out the crappy compilers over the better ones.
int x = 10;
int y = -2345;
int z = 24059;
double q;
int t;
while (1)
{
Pin1(high);
for(t=0;t<10000;t++)
{
q += t - ( (x + y) / (y + z) ) + 1 * t;
}
Pin1(Low);
}
Though this is straight line code as i call it. Its not in a RTOS environment. One would do something similar to test one RTOS to another. How efficient is one RTOS to another? doing bit banging test like this and thread swapping quickly will reveal all this to the coder.
Doing tests using hardware peripherals reveals nothing of what we are looking for.
Now that i have bored the crap out of you the last example might just bring this home.
Lets say some other company wanted to come out with something to compete with MS .NET.
the competitors is called .LINXMF.
As a coder how would you compare the throughput of these two platforms ?
The only way to do it is to force it to chug through code. Like bit twiddling and the example i gave above. To write an example say to the SPI port using .NETMF or .LINXMF the results would more than likely be the same as they are both writing to the hardware peripheral of the uP.