Hongtae Kim 5 years ago
parent
commit
6096bcd5ef
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      TestApp1/TestApp1.cpp

+ 10
- 6
TestApp1/TestApp1.cpp View File

17
 		DKLogD("%s", DKGL_FUNCTION_NAME);
17
 		DKLogD("%s", DKGL_FUNCTION_NAME);
18
 
18
 
19
 		DKTimer timer;
19
 		DKTimer timer;
20
-		for (auto format : { DKCompressor::Deflate, DKCompressor::LZ4, DKCompressor::LZ4HC })
20
+		for (auto format : { DKCompressor::Deflate, DKCompressor::Deflate9, DKCompressor::Zstd, DKCompressor::ZstdMax, DKCompressor::LZ4, DKCompressor::LZ4HC })
21
 		{
21
 		{
22
 			const char* fmt = [](DKCompressor::Method m) {
22
 			const char* fmt = [](DKCompressor::Method m) {
23
 				switch (m)
23
 				switch (m)
24
 				{
24
 				{
25
-				case DKCompressor::Deflate:	return "DEFLATE";
26
-				case DKCompressor::LZ4: return "LZ4";
27
-				case DKCompressor::LZ4HC:	return "LZ4HC";
25
+				case DKCompressor::Deflate:	    return "DEFLATE";
26
+                case DKCompressor::Deflate9:    return "DEFLATE(9)";
27
+                case DKCompressor::Zstd:        return "Zstd";
28
+                case DKCompressor::ZstdMax:     return "ZstdMax";
29
+				case DKCompressor::LZ4:         return "LZ4";
30
+				case DKCompressor::LZ4HC:	    return "LZ4HC";
28
 				}
31
 				}
29
 				return "Unknown";
32
 				return "Unknown";
30
 			}(format);
33
 			}(format);
80
 			double elapsed = timer.Elapsed();
83
 			double elapsed = timer.Elapsed();
81
 
84
 
82
 			if (result)
85
 			if (result)
83
-				DKLog("File Compressed (%s): %ls -> %ls (%fsec)", fmt,
84
-				(const wchar_t*)GetFileSizeStr(f1), (const wchar_t*)GetFileSizeStr(f2), elapsed);
86
+				DKLog("File Compressed (%s): %ls -> %ls (ratio:%f, %fsec)", fmt,
87
+				(const wchar_t*)GetFileSizeStr(f1), (const wchar_t*)GetFileSizeStr(f2),
88
+                      double(f1->TotalLength()) / double(f2->TotalLength()), elapsed);
85
 			else
89
 			else
86
 			{
90
 			{
87
 				DKLog("File Compression failed");
91
 				DKLog("File Compression failed");