A faster python pickle replacement
Project description
This module can be used as transparent replacement for pickle.
Difference to original python pickle:
no memo attribute.
no clear_memo().
no persistent_id interface.
byte strings are always assumed to be utf-8 encoded.
Pickler has an additional with_refs parameter. Setting with_refs to false, the pickler will ignore object references. This can result in an extra speed boost.
Installation
larch-pickle needs the boost library for compilation. If boost is not in the standard include path install it with:
python build_ext -I /path/to/boost install
Security
Version 1.4.0 introduced a secure parameter in Unpickler. With secure=True the Unpickler loads only objects that, are registered as secure. To register secure objects you can
use the decorator secure_unpickle
set the attribute __pickle_secure__ = True
add a module name to secure_modules
Speed compared to some other pickler packages
dump Dictionaries (10 loops)
Package |
Seconds |
Size |
---|---|---|
larch-pickle |
0.291857 |
9356357 |
marshal |
0.344505 |
15975952 |
msgpack |
0.368878 |
9810043 |
ujson |
0.550575 |
13101307 |
json |
0.815204 |
14365311 |
Pickle-3.12.2 |
1.16181 |
10276493 |
load Dictionaries (10 loops)
Package |
Seconds |
---|---|
larch-pickle |
0.719275 |
marshal |
0.767289 |
msgpack |
0.817542 |
Pickle-3.12.2 |
0.847736 |
json |
0.91282 |
ujson |
0.930489 |
dump Objects (10 loops)
Package |
Seconds |
Size |
---|---|---|
larch-pickle |
0.337152 |
9656364 |
Pickle-3.12.2 |
1.15342 |
10416542 |
load Objects (10 loops)
Package |
Seconds |
---|---|
larch-pickle |
0.794334 |
Pickle-3.12.2 |
0.820135 |
dump Strings (10 loops)
Package |
Seconds |
Size |
---|---|---|
marshal |
0.215026 |
32481517 |
msgpack |
0.251937 |
28782143 |
larch-pickle |
0.418834 |
10885236 |
json |
0.513742 |
31701248 |
ujson |
0.537478 |
30722275 |
Pickle-3.12.2 |
0.633869 |
17726498 |
load Strings (10 loops)
Package |
Seconds |
---|---|
larch-pickle |
0.206729 |
Pickle-3.12.2 |
0.253017 |
marshal |
0.359512 |
msgpack |
0.360152 |
json |
0.527622 |
ujson |
0.673696 |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for larch_pickle-1.4.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18c74fde0bdd0382598745633b6a230a28707bbd382e695fae1518324d926b8a |
|
MD5 | b7a1035c3bd2a25754e0c64347bf5ab3 |
|
BLAKE2b-256 | 4b9d81f6c01b6906223a7ffc769a878539fa10a6e6d757b6d66f27b78d2a8bc0 |
Hashes for larch_pickle-1.4.3-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43aa630e586c564605325effe87fd3f38692b71cf3f960efe48c2df4f7967a06 |
|
MD5 | 124cc70024e32f08a10f86874a8b62c4 |
|
BLAKE2b-256 | d3844741279b6d01cadcdc40cf242e325ecaa600e8c42635d26533f053a412b4 |
Hashes for larch_pickle-1.4.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0af8866c6d2d6b7e211ea7ac7d202fe2fc8bfa15774dfec686cb1c75f9e0e2c6 |
|
MD5 | 6c7f9efe5a2b7c059d284b66aa4efcbc |
|
BLAKE2b-256 | 44226dd08ce91cd0fafa14e0dd1b413972db52cf1f6bf26d05bb382010a5c8f7 |
Hashes for larch_pickle-1.4.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01bafdb4322c3d7cf111b9df5f4cbcdbfb5ffdd6ad3eecd4a40c57fedff52d5b |
|
MD5 | 6245491b0097dd0661710805aa456490 |
|
BLAKE2b-256 | fa7d9fdf2debdb7cdaf0e8bb82e24c1d3f78fa2549c39c5f8599a6721f9fa74e |
Hashes for larch_pickle-1.4.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 462be1dcaaaa88fef0d473d0ac8ae431f0e172778c44b080dbd68233731c3d51 |
|
MD5 | a6803f52202e0ed2fa941223de7ba47e |
|
BLAKE2b-256 | c9bd001e8dfef833966af59a6c9908c03b79c6232fed481017ef2eb8d6bb71af |
Hashes for larch_pickle-1.4.3-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9de944a602fb8621e0ad841641924353dbf5594bfecb2c262742b3b26f2a83b |
|
MD5 | 724cdde83749a7a60f0de04d38428005 |
|
BLAKE2b-256 | 1e64497e214981ef444528d30772d4eb7220c5f7c923b6e400723b13f7fb6506 |