Thread: [Compbench-devel] CompBenchmarks++/Benchmark Benchmark-xZIP.cpp, 1.2, 1.3 Benchmark-xZIP.h, 1.2, 1.
Brought to you by:
xfred
[Compbench-devel] CompBenchmarks++/Benchmark Benchmark-xZIP.cpp, 1.2,
1.3 Benchmark-xZIP.h, 1.2, 1.3
From: Frederic T. <xf...@us...> - 2007-01-03 22:02:15
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23308 Modified Files: Benchmark-xZIP.cpp Benchmark-xZIP.h Log Message: CBMPackage and new related API used. Index: Benchmark-xZIP.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-xZIP.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-xZIP.cpp 25 Sep 2006 15:38:51 -0000 1.2 --- Benchmark-xZIP.cpp 3 Jan 2007 22:02:11 -0000 1.3 *************** *** 4,13 **** #include <fstream> ! CBMBenchmarkxZIP::CBMBenchmarkxZIP(CBMSystem *_system) ! : CBMBenchmarkAutotools(_system) { } ! int CBMBenchmarkxZIP::preConfigure(int _force) { std::string fileName; --- 4,13 ---- #include <fstream> ! CBMPackagexZIP::CBMPackagexZIP(CBMSystem *_system) ! : CBMPackageAutotools(_system) { } ! int CBMPackagexZIP::preConfigure(int _force) { std::string fileName; *************** *** 28,34 **** } std::string CBMBenchmarkxZIP::bench(void) { ! time_t start = system->Time(); time_t end; std::string cmd; --- 28,43 ---- } + CBMPackagexZIP::~CBMPackagexZIP() + { + } + + CBMBenchmarkxZIP::CBMBenchmarkxZIP(CBMPackage *_package) + : CBMBenchmark(_package) + { + } + std::string CBMBenchmarkxZIP::bench(void) { ! time_t start = System()->Time(); time_t end; std::string cmd; *************** *** 38,42 **** cmd="cd "; ! cmd+=localPackageAbsoluteDirectory(); cmd+=" && ./"; cmd+=benchmarkProgram(); --- 47,51 ---- cmd="cd "; ! cmd+=package->localPackageAbsoluteDirectory(); cmd+=" && ./"; cmd+=benchmarkProgram(); *************** *** 45,56 **** cmd+="c Compbenchmarks.dat > /dev/null"; ! if (system->exec(cmd, sstdout)==0) { ! end=system->Time(); ! sprintf(dum, "%0.0f", ((float)benchmarkSize())/((int)(end-start))); result=dum; return(result); } else { return("0"); ! } } --- 54,65 ---- cmd+="c Compbenchmarks.dat > /dev/null"; ! if (System()->exec(cmd, sstdout)==0) { ! end=System()->Time(); ! sprintf(dum, "%0.0f", ((float)package->benchmarkSize())/((int)(end-start))); result=dum; return(result); } else { return("0"); ! } } *************** *** 58,60 **** { } - --- 67,68 ---- Index: Benchmark-xZIP.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-xZIP.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-xZIP.h 19 Sep 2006 17:09:35 -0000 1.2 --- Benchmark-xZIP.h 3 Jan 2007 22:02:11 -0000 1.3 *************** *** 13,27 **** ! /** \brief Defines an abstract benchmark based on xZIP utilities. * ! * This class can be overloaded in order to get new external benchmarks and packages ! * supported by CompBenchmarks. It provides a 70M (through preConfigure()) file that ! * can be compressed. */ ! class CBMBenchmarkxZIP : public CBMBenchmarkAutotools { private: protected: /** Compression level \return compression level ("0" .. "9") used. --- 13,56 ---- ! /** \brief Defines an abstract package based on ZIP utilities. * ! * This class can be overloaded in order to get new external packages ! * supported by CompBenchmarks. It provides a 70M (through preConfigure()) ! * file that can be compressed. ! * \sa CBMBenchmarkxZIP */ ! class CBMPackagexZIP : public CBMPackageAutotools { private: protected: + /** Pre-configure package + * Creates a ~70M files used for compression benchmarks. + * \param _force must be set to 1 to force operation. + * \sa CBMBenchmark::preConfigure() */ + virtual int preConfigure(int _force = 0); + + public: + /** Constructor */ + CBMPackagexZIP(class CBMSystem *_system); + + /** Virtual destructor */ + virtual ~CBMPackagexZIP(); + + }; + + /** \brief Defines an abstract benchmark based on ZIP utilities. + * + * This class can be overloaded in order to get new external packages + * supported by CompBenchmarks. It provides a 70M (through preConfigure()) + * file that can be compressed. + * \sa CBMPackagexZIP + */ + + class CBMBenchmarkxZIP : public CBMBenchmark + { + protected: + CBMBenchmarkxZIP(CBMPackage *_package); + /** Compression level \return compression level ("0" .. "9") used. *************** *** 34,55 **** virtual std::string benchmarkProgram(void) = 0; - /** Pre-configure package - * Creates a ~70M files used for compression benchmarks. - * \param _force must be set to 1 to force operation. - * \sa CBMBenchmark::preConfigure() */ - virtual int preConfigure(int _force = 0); /** Runs the benchmark * Gives the amount of compressed bytes per seconds (as CompBenchmarks always apply * "bigger is better" policy to benchmarks' results, we can just rely on time). */ - virtual std::string bench(void); - - public: - /** Constructor */ - CBMBenchmarkxZIP(class CBMSystem *_system); ! /** Virtual destructor */ virtual ~CBMBenchmarkxZIP(); - }; --- 63,73 ---- virtual std::string benchmarkProgram(void) = 0; /** Runs the benchmark * Gives the amount of compressed bytes per seconds (as CompBenchmarks always apply * "bigger is better" policy to benchmarks' results, we can just rely on time). */ ! virtual std::string bench(void); virtual ~CBMBenchmarkxZIP(); }; |