Skip to main content

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

larch-pickle-1.4.3.tar.gz (4.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

larch_pickle-1.4.3-cp312-cp312-win_amd64.whl (94.6 kB view details)

Uploaded CPython 3.12Windows x86-64

larch_pickle-1.4.3-cp312-cp312-macosx_10_9_universal2.whl (228.7 kB view details)

Uploaded CPython 3.12macOS 10.9+ universal2 (ARM64, x86-64)

larch_pickle-1.4.3-cp311-cp311-win_amd64.whl (95.5 kB view details)

Uploaded CPython 3.11Windows x86-64

larch_pickle-1.4.3-cp311-cp311-macosx_10_9_universal2.whl (233.7 kB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

larch_pickle-1.4.3-cp310-cp310-win_amd64.whl (94.9 kB view details)

Uploaded CPython 3.10Windows x86-64

larch_pickle-1.4.3-cp310-cp310-macosx_11_0_x86_64.whl (120.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

File details

Details for the file larch-pickle-1.4.3.tar.gz.

File metadata

  • Download URL: larch-pickle-1.4.3.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for larch-pickle-1.4.3.tar.gz
Algorithm Hash digest
SHA256 560575f0061bf4e598adfc10f2b84b0ae3b61f8c27734fdd62775a5659c3a611
MD5 b9793bf8444e157c54303b023f4a98ba
BLAKE2b-256 bf932371f39f3ebca0bb266718cc5ef4151de20086bd163c28127e002c6ca387

See more details on using hashes here.

File details

Details for the file larch_pickle-1.4.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for larch_pickle-1.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 18c74fde0bdd0382598745633b6a230a28707bbd382e695fae1518324d926b8a
MD5 b7a1035c3bd2a25754e0c64347bf5ab3
BLAKE2b-256 4b9d81f6c01b6906223a7ffc769a878539fa10a6e6d757b6d66f27b78d2a8bc0

See more details on using hashes here.

File details

Details for the file larch_pickle-1.4.3-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for larch_pickle-1.4.3-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 43aa630e586c564605325effe87fd3f38692b71cf3f960efe48c2df4f7967a06
MD5 124cc70024e32f08a10f86874a8b62c4
BLAKE2b-256 d3844741279b6d01cadcdc40cf242e325ecaa600e8c42635d26533f053a412b4

See more details on using hashes here.

File details

Details for the file larch_pickle-1.4.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for larch_pickle-1.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0af8866c6d2d6b7e211ea7ac7d202fe2fc8bfa15774dfec686cb1c75f9e0e2c6
MD5 6c7f9efe5a2b7c059d284b66aa4efcbc
BLAKE2b-256 44226dd08ce91cd0fafa14e0dd1b413972db52cf1f6bf26d05bb382010a5c8f7

See more details on using hashes here.

File details

Details for the file larch_pickle-1.4.3-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for larch_pickle-1.4.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 01bafdb4322c3d7cf111b9df5f4cbcdbfb5ffdd6ad3eecd4a40c57fedff52d5b
MD5 6245491b0097dd0661710805aa456490
BLAKE2b-256 fa7d9fdf2debdb7cdaf0e8bb82e24c1d3f78fa2549c39c5f8599a6721f9fa74e

See more details on using hashes here.

File details

Details for the file larch_pickle-1.4.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for larch_pickle-1.4.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 462be1dcaaaa88fef0d473d0ac8ae431f0e172778c44b080dbd68233731c3d51
MD5 a6803f52202e0ed2fa941223de7ba47e
BLAKE2b-256 c9bd001e8dfef833966af59a6c9908c03b79c6232fed481017ef2eb8d6bb71af

See more details on using hashes here.

File details

Details for the file larch_pickle-1.4.3-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page