Math API performance: saving CPU cycles?

Started by
21 comments, last by ATC 11 years, 7 months ago

I didn't mean that a programmer could achieve better results through hand coded assembly, I think the point that I and those commenters were making is that unless you post the output assembly for the benchmarks, there's no way of knowing if the computer is really doing the same thing in both cases. If I understood correctly what people were saying was because the benchmark test was just buffering a string and never actually doing anything with it, that the JIT compiler was likely optimizing out the entire benchmark test. However, without the raw assembly output, we'll never know. That's all I was saying.


That still proves the point even if that's the case... the fact that a JIT compiler could make such a marked optimization that a C compiler cannot. Imagine the compounded result of tons of major optimizations, just from the compiler, in the context of a huge program.
_______________________________________________________________________________
CEO & Lead Developer at ATCWARE™
"Project X-1"; a 100% managed, platform-agnostic game & simulation engine

Please visit our new forums and help us test them and break the ice!
___________________________________________________________________________________
Advertisement

That still proves the point even if that's the case... the fact that a JIT compiler could make such a marked optimization that a C compiler cannot. Imagine the compounded result of tons of major optimizations, just from the compiler, in the context of a huge program.


No disagreement there, but it still makes for a poor benchmark smile.png

No disagreement there, but it still makes for a poor benchmark


You can argue that, sure. Perhaps someday we as a community should get together and do some rigorous benchmarking of C, C++, C# (in a scientific, emperical fashion) and various other languages and make a page dedicated to the results; to help game programmers make optimization decisions. But until that day, I'm just going to worry about squeezing the most performance out of my C# math API as possible; whether or not C or C# is the faster is irrelevant to what I'm doing; in any case C# is plenty fast enough because I've seen it with own eyes -- running 7500fps on extremely data-heavy, complex scenes without culling. ;-)

So back on topic... what else could I do to optimize math routines? What pitfalls should I be looking out for? What tips and tricks should be kept in mind? And again, has anyone used or know anything about Intel's Math Kernel Library?
_______________________________________________________________________________
CEO & Lead Developer at ATCWARE™
"Project X-1"; a 100% managed, platform-agnostic game & simulation engine

Please visit our new forums and help us test them and break the ice!
___________________________________________________________________________________

This topic is closed to new replies.

Advertisement