Jump to content
  • Advertisement
Sign in to follow this  
Misery

Windows/Linux Flexible performance counter

This topic is 2453 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I am working on full and sparse matrix library in C++.
I have some code that I could begin to optimize a little. Therefore I need performance counter.
I have found some useful posts and solutions for Windows, but for short period computations.
What I need is a counter that will work on Linux and Windows (using preprocessor macros is ok to choose instructions for lin or win within compilation).
But what is more important, it should measure wide variety of times.
To test some small parts of code I would need resolution about 1 ms (like in QueryPerformance functions), but for greater tasks it should be able to measure time with lets say 1 s resolution, but those computations may take even a week or so.
I have compeletly no idea how to create something lke that.

Thanks in advance,
Regards

Share this post


Link to post
Share on other sites
Advertisement
If you mean "performance counter" as in "using hardware performance counters" I cannot help, but if you want just doing performance monitoring, I'd suggest using pintool (here), that let's you instrument application at a wide variety of levels, and using something like gettimeofday to keep track of the time

Share this post


Link to post
Share on other sites
How about just calling rdtsc from an asm block (code on wiki for Linux and Windows)? Since you just want relative times, you don't even have to do the unit normalization math. Should be accurate to well under a microsecond, and there shouldn't be any clock related issues unless you are running a really old PC.

BTW, why not use Atlas or MKL?

Share this post


Link to post
Share on other sites
I just want to keep things simple. For Altlas I would need to compile it, tune it and so on... also change BIOS settings if necessary. And i am writing matrix lib for non-programmers really but for ppl who use programming just to solve some math problems. I don't want them to be forced to build Atlas for example, move it to Windows, cross compile sometimes and so on :]

Thanks for help.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!