Skip to content

Commit

Permalink
Add logging of compression ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
SwadicalRag committed Jun 9, 2019
1 parent c50df21 commit 69fc749
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 69fc749

Please sign in to comment.