Home | History | Annotate | Download | only in Common
      1 // Bench.h
      2 
      3 #ifndef __7ZIP_BENCH_H
      4 #define __7ZIP_BENCH_H
      5 
      6 #include "../../Common/CreateCoder.h"
      7 
      8 struct 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 
     20 struct IBenchCallback
     21 {
     22   virtual HRESULT SetEncodeResult(const CBenchInfo &info, bool final) = 0;
     23   virtual HRESULT SetDecodeResult(const CBenchInfo &info, bool final) = 0;
     24 };
     25 
     26 UInt64 GetUsage(const CBenchInfo &benchOnfo);
     27 UInt64 GetRatingPerUsage(const CBenchInfo &info, UInt64 rating);
     28 UInt64 GetCompressRating(UInt32 dictionarySize, UInt64 elapsedTime, UInt64 freq, UInt64 size);
     29 UInt64 GetDecompressRating(UInt64 elapsedTime, UInt64 freq, UInt64 outSize, UInt64 inSize, UInt32 numIterations);
     30 
     31 HRESULT LzmaBench(
     32   DECL_EXTERNAL_CODECS_LOC_VARS
     33   UInt32 numThreads, UInt32 dictionarySize, IBenchCallback *callback);
     34 
     35 const int kBenchMinDicLogSize = 18;
     36 
     37 UInt64 GetBenchMemoryUsage(UInt32 numThreads, UInt32 dictionary);
     38 
     39 bool CrcInternalTest();
     40 HRESULT CrcBench(UInt32 numThreads, UInt32 bufferSize, UInt64 &speed);
     41 
     42 #endif
     43