What performance counter type to use?
We do use zip compression in our application quite extensively. I need to measure performance of different zip compressors using real life data (synthetic tests that we performed appear to be not very precise) compressed/uncompressed inside the application.
There is a utility method doing compression/decompression on demand, so I need to measure its performance and get some average. This average is basically an average rate (total number of bytes compressed divided by total time spent).
I played with different types of performance counters and I'm a little confused by the results.
What type of counter is the most appropriate in my case? Would it be RateOfCountsPerSecond64 or AverageCount64? Again, I don't need to change counter value when the system is idle; average should stay the same. Time elap开发者_StackOverflowsed while the system is idle doesn't count as well.
I don't believe you're going to directly find a performance counter that indicates the overall score for any given compressor/decompressor.
As belisarius commented, you have at least two independent variables that contribute to the score:
- compression ratio
- time spent
And there may be others:
- size of input file
- whether the compression algorithm is well suited for the given input data (for example, some compression techniques work better depending on whether the input file is text, graphics, video, etc.)
And so on. If I were you, I would measure the raw values of each independent variable with its own performance counter, or even multiple counters.
Then, use the Performance Monitor Data Collector to collect logs of these counters, and crunch them later, where you can weight dimensions to suit your analysis (figure out whether it matters more to have faster compression or a higher compression ratio, and discard edge cases, etc.).
Also, the following codeproject.com article has a nice breakdown of different counters and useful examples of what they would measure. http://www.codeproject.com/Articles/42001/NET-Best-Practice-No-3-Using-performance-counters
精彩评论