Skip to content

Commit

Permalink
zstd doesn't have kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Jun 18, 2024
1 parent 0ad7473 commit 786efde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mqclient/broker_client_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def serialize(data: Any, headers: Optional[Dict[str, Any]] = None) -> bytes:

return zstd.compress(
json.dumps({"headers": headers, "data": data}).encode("utf-8"),
__threads=1,
3, # level (3 is default)
1, # num of threads (auto is default)
)


Expand Down
6 changes: 5 additions & 1 deletion resources/message_compression_benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ def main():
elif args.algo == "zstd":
import zstd # type: ignore

zstd_compress_1thread = lambda x: zstd.compress(x, -3, 1) # -3 is default
zstd_compress_1thread = lambda x: zstd.compress( # noqa: E731
x,
3, # level (3 is default)
1, # num of threads (auto is default)
)
if args.only_size:
compare_size(args.algo, zstd_compress_1thread, data)
else:
Expand Down

0 comments on commit 786efde

Please sign in to comment.