A C++ implementation with Python bindings of StreamVByte.
Project description
Table of Contents
About The Project
libstreamvbyte
is a C++
implementation of StreamVByte, with Python
bindings using pybind11
.
StreamVByte is a integer compression technique that use SIMD instructions (vectorization) to improve performance. The library is optimized for CPUs with the SSSE3
instruction set (which is supported by most x86_64 processors), and can also be used with ARM processors and other 32-bit architectures, although it will fall back to scalar implementations in those cases.
With libstreamvbyte
, you can quickly and efficiently compress integer sequences, reducing the amount of storage space and network bandwidth required. The library is easy to use and integrates seamlessly with Python
via pybind11
bindings. Whether you're working with large datasets or building a distributed computing system, libstreamvbyte
can help you improve performance and reduce the resources needed to handle your data.
Currently supports Python 3.10+
on Windows, Linux (manylinux_2_17
, musllinux_1_1
) and macOS (universal2
).
Getting Started
Installation
Using pip
pip install libstreamvbyte
Using .whl
See releases.
Usage
Import libstreamvbyte
first.
import libstreamvbyte as svb
And here are the APIs.
# Encode a list of integers into a byte array.
# Currently only supports np.uint32
encode(arg0: numpy.ndarray[numpy.uint32]) -> numpy.ndarray[numpy.uint8]
# Decode a byte array into a list of integers.
decode(arg0: numpy.ndarray[numpy.uint8], arg1: int) -> numpy.ndarray[numpy.uint32]
Example
import libstreamvbyte as svb
N = 2**20
# type(before_encode) == np.ndarray
# before_encode.dtype == np.uint32
before_encode = np.random.randint(0, 2**32, N, dtype=np.uint32)
# type(compressed_bytes) == np.ndarray
# compressed_bytes.dtype == np.uint8
compressed_bytes = svb.encode(before_encode)
# type(after_decode) == np.ndarray
# after_decode.dtype == np.uint32
after_decode = svb.decode(compressed_bytes, N)
Roadmap
- Zigzag encoding/decoding.
- Support ARM processors with
NEON
intrinsics. - Differential coding (delta encoding/decoding).
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feat/amazing-feature
) - Commit your Changes with Conventional Commits
- Push to the Branch (
git push origin feat/amazing-feature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
Reference
- Daniel Lemire, Nathan Kurz, Christoph Rupp, Stream VByte: Faster Byte-Oriented Integer Compression, Information Processing Letters 130, 2018.
Contact
Author
- HSING-HAN, WU (Xyphuz)
- Mail me: xyphuzwu@gmail.com
- About me: https://www.xyphuz.com
- GitHub: https://github.com/wst24365888
Project Link
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file libstreamvbyte-0.1.1.tar.gz
.
File metadata
- Download URL: libstreamvbyte-0.1.1.tar.gz
- Upload date:
- Size: 759.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2a193e38b8726a1bde6ba7ab3e51edde2117c2ce313279f54ae57de7b0f244b |
|
MD5 | 76e7a4166e3b5031af521ae168a43a37 |
|
BLAKE2b-256 | 10ac8937e7ad2d3fdee9256d5d037977c5451d210fbaa5b5afc43a5f33caa4fb |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 57.9 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 996546845e2ac1eddc30010120de878d4896b619affbf76633f795874cb8de41 |
|
MD5 | 013c2ecbba93cc58d3ea5307bdf011da |
|
BLAKE2b-256 | 0c023e424dcdb77b21d6601cb6b50a40cea67c27f9dee0eef3f127c71202d614 |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-win32.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-win32.whl
- Upload date:
- Size: 46.4 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67de69b6a55b46b5f1dba0123ef7205faee4b54c72c0b6ca12e3f06f62e77f9 |
|
MD5 | 48f0bcd95be5f7ac04e354c386131747 |
|
BLAKE2b-256 | 2f1793d41a99be62a2179830aa08fb20fe386df908776fcacd389995ab788f80 |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 604.2 kB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d64fb927b251fc94587d13623c717ad4fb1110d63c74dd25079e712235ee864 |
|
MD5 | 068688e6805f47028c1ca7e88f087fb6 |
|
BLAKE2b-256 | de8639f78b994e46f4aa9ed2713940d6cdaadfe68b50c4ec63ce89a814731ff0 |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-musllinux_1_1_i686.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-musllinux_1_1_i686.whl
- Upload date:
- Size: 659.8 kB
- Tags: CPython 3.11, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d3a97a12c2b4913f7af5ef8f33025a81ae9f24ecd1388ca88fad507672fd84b |
|
MD5 | 73d9c8646051f2bfa2173dd4aef2096c |
|
BLAKE2b-256 | d5da2155e3c9c9cd7ec6ba7d4cc13cec56c9f6ee304f299b9c2f676e6d06e498 |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-musllinux_1_1_aarch64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-musllinux_1_1_aarch64.whl
- Upload date:
- Size: 585.3 kB
- Tags: CPython 3.11, musllinux: musl 1.1+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30dca584146d49afc555eb8b0164cdd6e48e4ee237fc064b7a420968fbc1a469 |
|
MD5 | 01111d90b5bd9cc6e75aa43400378ffb |
|
BLAKE2b-256 | 0db985e6336b5819583d5ec20ccc0780468142a69741277acea7a266e1c5f67f |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 78.7 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6968950270f3801fd70d003d7580cc8c0f049279230ab05d6d432ce19774461a |
|
MD5 | 688bcc451b2aed20700be938fff87da5 |
|
BLAKE2b-256 | 20c232729093adeb2fbf409c90644f235ac8bef83f367b07a39033b71bd93f6b |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 82.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99bb08623717f46fdcfeae9173cb9c5e9f52184ccf9536c7192550a724e279b4 |
|
MD5 | 81b122165dce9a9f35feb082c6fd3a03 |
|
BLAKE2b-256 | e687417f509d3a0f616586e85523982caf1afda49b549328fff8243bf039a0f0 |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 72.8 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf5fda3ab1354d4b79eaa0a9cbd61a213111f60cf0a18a4c140dce9e2bc93da5 |
|
MD5 | 2af83466103b4c5c6d1ebf836610ba94 |
|
BLAKE2b-256 | 6a4d335bca4e6461f1cde8054ae616acf88c4f176e9ef91227c48f4d473dc646 |
File details
Details for the file libstreamvbyte-0.1.1-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 100.0 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6ff1a35dd2cf8ace9f21258ec000fb8aef5ef3826b0ec0aac809efa3e267700 |
|
MD5 | a08a81621bbe989d4773186cad6dcc48 |
|
BLAKE2b-256 | 29108c276556c755108128745aface1978335308dcfd0010744cc0a753bf6ee5 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 57.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 816d904e53bb286f2f07bfaba66ba525ddbe9dd218a9a45dd383c9fb3eab93ae |
|
MD5 | 690cedff9717ab501f2f7482029bd97d |
|
BLAKE2b-256 | e781d7da83b3a4831cf5b7e37d7b6998a15f702c8e8cc03136e36ba50d245a16 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-win32.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-win32.whl
- Upload date:
- Size: 46.4 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 423843e87db8f0cb942fc5e74790bdd94ad6a2177d93dfef7bb40981fecb90ef |
|
MD5 | 39770564c65131bf5d48d6bfcd3c3271 |
|
BLAKE2b-256 | ed10815ee73508c998fdee1ce0d43e657b5ed5490946a6fb55e3b09f4600c616 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 604.1 kB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c6a5fe23d36c6c51657d38c049a3db124cacc11ed16d86de9c2bed281be445 |
|
MD5 | beec03a3f91405a251a9d7b3f623ab88 |
|
BLAKE2b-256 | 259934d5de61ad185ada4830c08b9762687ed41197a72bb1504992ec960968e3 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-musllinux_1_1_i686.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-musllinux_1_1_i686.whl
- Upload date:
- Size: 659.9 kB
- Tags: CPython 3.10, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d33c7a06273699d1e10c65e23364b9995685590b86c3608d2bd02c2462d97483 |
|
MD5 | 36f6b804d4d38fabbf3e9e0d03dc8e7f |
|
BLAKE2b-256 | ea58fecc03eaf50f1592372d81e87eb313519b492fe6a7a38a141d6495f0192f |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-musllinux_1_1_aarch64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-musllinux_1_1_aarch64.whl
- Upload date:
- Size: 585.4 kB
- Tags: CPython 3.10, musllinux: musl 1.1+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b54ec8a434d30c2c16dd3a45c0e35e0c13237c80eb78f5a36edef6e9383fdb28 |
|
MD5 | 1dafab01417f7b1a502565e281f11dca |
|
BLAKE2b-256 | 6799cdec259502b2f8016c63f377670b0bef5b0cc698cd33500756644760a57a |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 78.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4fc76d54140ab98c0deaa4b192b2d5d749cace0bc29463002871f71a595982 |
|
MD5 | 308295a01652d50a43239c954e58f80d |
|
BLAKE2b-256 | af6a2550baeddedd044c723878ca5dec12a01219c4b44db42b3cb70dc00d9770 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 82.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e232df38620fb747e70683164c7fdabaea4c75784a6c1f84afa83eadfd48283d |
|
MD5 | e5ef7b753d287112db3e2d1c235ef8a0 |
|
BLAKE2b-256 | 8ed2969d64b9a334a25eee133957ff9cab824f048de1a640d2ae7626dbc2a196 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 72.8 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7d0f65e2893c384ef8556f6b6065a18db5b30a88fb1125d0b3656501a80a0e8 |
|
MD5 | 3c9e9cc4ef3cb9b8edb161b52e96be68 |
|
BLAKE2b-256 | ab5a580557948e0db8b668633c31ada8b7515ef333079a12f3257c34a4828011 |
File details
Details for the file libstreamvbyte-0.1.1-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: libstreamvbyte-0.1.1-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 100.0 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ae5f0773efd8f9106d067a80723da13359925c64d33bd138eaa47e1fed1f19 |
|
MD5 | fa4996251fa43bf7027250b204e995d3 |
|
BLAKE2b-256 | a851abf1398d1d492fe8688116f0ce372d46cb8777f5a52b7df75258e1530ebf |