private static ulong GetCompressRating(uint dictionarySize, ulong elapsedTime, ulong size) { ulong t = LzmaBench.GetLogSize(dictionarySize) - (18 << LzmaBench.kSubBits); ulong numCommandsForOne = 1060 + ((t * t * 10) >> (2 * LzmaBench.kSubBits)); ulong numCommands = size * numCommandsForOne; return(LzmaBench.MyMultDiv64(numCommands, elapsedTime)); }
private static void PrintResults(uint dictionarySize, ulong elapsedTime, ulong size, bool decompressMode, ulong secondSize) { ulong speed = LzmaBench.MyMultDiv64(size, elapsedTime); LzmaBench.PrintValue(speed / 1024); Console.Write(" KB/s "); ulong rating; if (decompressMode) { rating = LzmaBench.GetDecompressRating(elapsedTime, size, secondSize); } else { rating = LzmaBench.GetCompressRating(dictionarySize, elapsedTime, size); } LzmaBench.PrintRating(rating); }
private static ulong GetDecompressRating(ulong elapsedTime, ulong outSize, ulong inSize) { ulong numCommands = inSize * 220 + outSize * 20; return(LzmaBench.MyMultDiv64(numCommands, elapsedTime)); }