GithubHelp home page GithubHelp logo

gitrj95 / littleintpacker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lemire/littleintpacker

0.0 0.0 0.0 87 KB

C library to pack and unpack short arrays of integers as fast as possible

License: Apache License 2.0

Python 2.45% C 97.32% Makefile 0.23%

littleintpacker's Introduction

LittleIntPacker

C library to pack and unpack short arrays of integers as fast as possible

Introduction

This is a bit packing library. Bit packing is the process by which you take arrays of (32-bit) integers that fit in [0,2^L) and you write them out using as close to L bits per integer as possible.

Motivation

For long blocks of integers (e.g., 128 integers or more), SIMD bit packing is ideal. See for example https://github.com/lemire/simdcomp where blocks of 128 integers are packed and unpacked very fast.

However, what happens if you have small blocks having variable lengths, and lengths that are typically much smaller than 128 integers?

The work is motivated by the engineering underlying TurboPFor https://github.com/powturbo/TurboPFor That is, we write and load compressed bytes in 64-bit words as opposed to 32-bit words.

Hardware requirements

This software makes little sense if you do not have a 64-bit processor.

Usage

make
./unit 

Code usage

//#include "bitpacking.h

// number of bytes required to compress l 32-bit integers using b bits each
uint32_t c = byte_count(l, b);

// packing an array of 32-bit unsigned ints from data to buffer
turbopack32(data, l, b,buffer);
// recovering data
turbounpack32(buffer, l, b,backdata);

Current status

Tested.

References

Other relevant libraries

littleintpacker's People

Contributors

lemire avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.