Fredrik
Fredrik

Reputation: 903

How to test a computer real general performance within C/C++ in a cross platform manner?

I want a way to test a computers real "overall" performance within C++ in a cross platform manner.

I'm consider to run some simple tests whose is often used in benchmark suites software, but all benchmark (software) suites as I have found are either closed source or not cross platform. Therefore am I asking for advice/guidance, which algorithms are preferred? Are there any already free standalone libraries out there which I already can use without much job? Any help are appreciate.

I am consider to test:

I have been thinking if it is a good idea to just copy Google V8 benchmark JavaScript tests and run them in my already embedded JavaScript V8 engine: http://v8.googlecode.com/svn/data/benchmarks/v3/run.html

I have some thoughts to do some simple disk copying, data compression/decompression, factorial primes. For video card performance could I simple use SFML/OpenGL and do some GPU intensive things. But doing all those things should take some time for me, and it may not even be a good thing to do from the beginning, therefore the question:

How to test a computer real general performance within C/C++ in a cross platform manner?

If you got tips on good algorithms which I may want to use, please let me know, it could only help.

Thanks in advance!

N.B I could check available hardware, but I believe the best way is to actually measure computer performance is to test it.

Upvotes: 2

Views: 2194

Answers (1)

Antti Huima
Antti Huima

Reputation: 25522

"Real general performance" is best tested by running actual applications on the computer and measuring their performance. That's why 3D benchmarks include "real" 3D scenes that resemble "real" games as much as possible. The same goes with memory and CPU speed --- the most important thing is how a real memory- and CPU-intensive application runs on the computer. It's quite hard to mimic the operational fingerprint of a suite of real multimillion line applications with a small program.

I would rather collect some (open-source) real programs and find a way to run them automatically to assess performance. For example, take the GNU C compiler and run it to compile a big application; take any open-source accelerated 3D game (yes, they exist) and maybe patch it so that it runs for a specific number of frames, etc. For hard disk speed, take an open-source full-text indexing tool that builds an index on the hard disk directly, or an open-source database and perform lots of inserts and deletes etc. Then build a portfolio of tests based on real applications and then build a performance index out of those.

Upvotes: 1

Related Questions