Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Windows/Linux Flexible performance counter


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Misery   Members   -  Reputation: 317

Like
0Likes
Like

Posted 16 March 2012 - 12:53 AM

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

Sponsor:

#2 Rekai   Members   -  Reputation: 102

Like
0Likes
Like

Posted 16 March 2012 - 03:56 AM

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

#3 Crowley99   Members   -  Reputation: 178

Like
1Likes
Like

Posted 16 March 2012 - 05:56 PM

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?

#4 Misery   Members   -  Reputation: 317

Like
0Likes
Like

Posted 22 March 2012 - 05:37 AM

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.

#5 Crowley99   Members   -  Reputation: 178

Like
0Likes
Like

Posted 22 March 2012 - 10:13 AM

Prebuilt binaries are available. They won't havee optimal perf, but they should be close.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS