1// Bench.h 2 3#ifndef __7ZIP_BENCH_H 4#define __7ZIP_BENCH_H 5 6#include "../../Common/CreateCoder.h" 7 8struct CBenchInfo 9{ 10 UInt64 GlobalTime; 11 UInt64 GlobalFreq; 12 UInt64 UserTime; 13 UInt64 UserFreq; 14 UInt64 UnpackSize; 15 UInt64 PackSize; 16 UInt32 NumIterations; 17 CBenchInfo(): NumIterations(0) {} 18}; 19 20struct IBenchCallback 21{ 22 virtual HRESULT SetEncodeResult(const CBenchInfo &info, bool final) = 0; 23 virtual HRESULT SetDecodeResult(const CBenchInfo &info, bool final) = 0; 24}; 25 26UInt64 GetUsage(const CBenchInfo &benchOnfo); 27UInt64 GetRatingPerUsage(const CBenchInfo &info, UInt64 rating); 28UInt64 GetCompressRating(UInt32 dictionarySize, UInt64 elapsedTime, UInt64 freq, UInt64 size); 29UInt64 GetDecompressRating(UInt64 elapsedTime, UInt64 freq, UInt64 outSize, UInt64 inSize, UInt32 numIterations); 30 31HRESULT LzmaBench( 32 DECL_EXTERNAL_CODECS_LOC_VARS 33 UInt32 numThreads, UInt32 dictionarySize, IBenchCallback *callback); 34 35const int kBenchMinDicLogSize = 18; 36 37UInt64 GetBenchMemoryUsage(UInt32 numThreads, UInt32 dictionary); 38 39bool CrcInternalTest(); 40HRESULT CrcBench(UInt32 numThreads, UInt32 bufferSize, UInt64 &speed); 41 42#endif 43