So anyways, my next idea is to benchmark the differences in optimizing for different CPU architectures. I found this,
https://www.eembc.org/coremark/index.php a benchmark designed to test integer and pipeline speed on various CPU's see the Details part of the above page.
So I downloaded the source and built it and now share it, it is attached and includes the logs I generated.
Ideally to test, it needs to be rebuilt with different flags, make clean and then make, or make XCFLAGS="options" such as -march=pentium4. The -march targets an architecture. I tested no flags, seems our GCC now targets i686, Pentium 4, and native, in my case I5 as well as -march=pentium4 -mtune=generic. The -mtune parameter affects the instruction ordering with generic being for the common CPU's available and used when GCC was released.
The results showed most tests resulting in about 16200 Iterations/Sec with the best results actually for -march=pentium4 -mtune=generic, 16241 Iterations/Sec with most of the others being close enough that it may be background processes affecting the results (should really run 3-5 times and average). The exception being plain old -march=pentium4 which gave 13162 Iterations/Sec, bigger numbers are better and it seems P4 has close to a 20% performance hit on my CPU and likely on all Intel CPU's besides Netburst and likely similar on AMD. AMD should be tested.
By uncommenting the LFLAGS_END line in os2/core_portme.mak and using make XCFLAGS="-DMULTITHREAD=4 -DUSE_PTHREAD" can test 4 threads, where my results were Iterations/Sec : 59947.545897 with no flags and for P4, Iterations/Sec : 50128.454164, once again a performance hit of about 15%.
My idea is for the RPM packagers to simply add CFLAGS+= -mtune=generic to their future P4 builds which should result in a performance boost in most cases for everyone except the few P4 users left without having to switch architectures and rebuild everything.
Anyways source is included, requirements to build are simply GCC and make, pthread-dev for multi-threading. "make XCFLAGS="-march=amdfam10" for newer AMD chips if others want to check out the differences. Don't forget to make clean in between compilations.
Now I should find a floating point benchmark and test that.
Edit: XCFLAGS="-march=native" is a simple way to test on your CPU