From 69fc749fc2f823540754a45824f9e33d4d3617a5 Mon Sep 17 00:00:00 2001 From: swadical Date: Sun, 9 Jun 2019 15:16:14 +0930 Subject: [PATCH] Add logging of compression ratio --- test.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test.lua b/test.lua index 38a2d45..8f25262 100644 --- a/test.lua +++ b/test.lua @@ -19,6 +19,8 @@ assert(module.bindings.global.BrotliEncoderCompress( ),"Compression failed") print("Compression took "..(os.clock() - t).."s") +print("Compression ratio: "..(#inputStr / compBuf.len()).."x") + t = os.clock() local outBuf = {__wasmMaxLen = #inputStr} assert(module.bindings.global.BrotliDecoderDecompress(compBuf,outBuf,"Decompression failed"))