Skip to content

Julia struct-s packed at bit boundaries into a primitive 64 bit type.

License

Notifications You must be signed in to change notification settings

rryi/BitStructs.jl

Repository files navigation

BitStructs.jl

Julia struct-s packed at bit boundaries into a primitive 64 bit type.

Stable Dev Build Status Build Status Build Status Coverage

BitStructs has the following use cases in mind:

  • memory reduction for tables with fields having very few instances like flags, status info, enumerations. A couple of columns in such tables could be combined into a Vector{T<:BitStruct}

  • pooling of several method parameters in one BitStruct instance. This reduces push/pop overhead in method execution for methods which are not inlined, and can improve runtime performance, because the compiler gets more choices for keeping data in CPU registers.

  • reading and writing of bitpacked binary data

current state: in development

As soon as I think the package is usable, it will become a registered julia package.

see test/tutorial.jl for an introduction

see test/benchmarks.jl for some timing comparisons

With julia 1.6-RC1, reading fields is nearly as fast as reading fields in standard julia struct-s. Older julia releases do not perform full constant propagation on field read access ==> 100-1000 times slower.

Setting fields is currently under investigation.

About

Julia struct-s packed at bit boundaries into a primitive 64 bit type.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages