Skip to content

Commit 00575ee

Browse files
committed
use zstandard instead of brotli
1 parent 6311756 commit 00575ee

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lmdb_cache/lmdb_cache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import lmdb
99
from pathlib import Path
1010
import dill
11-
import brotli
11+
import zstandard
1212
from more_itertools import chunked
1313

1414

@@ -255,12 +255,12 @@ class SerializeWithCompressionMixIn(SerializeMixIn):
255255
@classmethod
256256
def serialize(cls, obj) -> bytes:
257257
data = super().serialize(obj)
258-
data = brotli.compress(data, quality=3)
258+
data = zstandard.compress(data, level=3)
259259
return data
260260

261261
@classmethod
262262
def deserialize(cls, data: bytes) -> Any:
263-
data = brotli.decompress(data)
263+
data = zstandard.decompress(data)
264264
data = super().deserialize(data)
265265
return data
266266

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ build-backend = "hatchling.build"
55
[project]
66
name = "lmdb_cache"
77
description = "LMDB cache which supports multiprocessing"
8-
version = "1.0.5"
8+
version = "1.1.0"
99
readme = {file = "README.md", content-type = "text/markdown"}
1010
requires-python = ">=3.10"
1111
dependencies = [
1212
"lmdb",
1313
"dill",
14-
"brotli",
14+
"zstandard",
1515
"more-itertools"
1616
]
1717

tests/test_lmdb_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_varied_batch_and_map_size(
182182
tmp_path, batch_size, size_multiplier, class_under_test
183183
):
184184
db_path = tmp_path / "lmdb_varied"
185-
data = generate_dataset(batch_size * 2, 1)
185+
data = generate_dataset(batch_size * 2, 10)
186186
db = class_under_test.from_iterable(
187187
db_path,
188188
data,

0 commit comments

Comments
 (0)