All Projects → hashd → bitmap-elixir

hashd / bitmap-elixir

Licence: MIT license
Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to bitmap-elixir

Ewahboolarray
A compressed bitmap class in C++.
Stars: ✭ 381 (+1170%)
Mutual labels:  bitset, bitmap
Csharpewah
Compressed bitmaps in C#
Stars: ✭ 59 (+96.67%)
Mutual labels:  bitset, bitmap
Fastbitset.js
Speed-optimized BitSet implementation for modern browsers and JavaScript engines
Stars: ✭ 118 (+293.33%)
Mutual labels:  bitset, bitmap
AsciiMap
Creates ASCII Art from Bitmaps
Stars: ✭ 21 (-30%)
Mutual labels:  bitmap
cocoa-close-pixelate
Cocoa port of https://github.com/desandro/close-pixelate
Stars: ✭ 47 (+56.67%)
Mutual labels:  bitmap
ImageSaveandShare
Library to save image locally and shows options to open and share !
Stars: ✭ 27 (-10%)
Mutual labels:  bitmap
jitmap
LLVM-jitted bitmaps
Stars: ✭ 25 (-16.67%)
Mutual labels:  bitmap
CQULogo
重庆大学视觉标识素材包 --- Visual Identification Bundle of Chongqing University
Stars: ✭ 55 (+83.33%)
Mutual labels:  bitmap
BitLens
🔎 Have your bits and eat them too! A C++17 bit lens container for vector types.
Stars: ✭ 20 (-33.33%)
Mutual labels:  bitset
lock-bitmap
A very small class to work with images faster in .net
Stars: ✭ 20 (-33.33%)
Mutual labels:  bitmap
Gifflen-Android
Android上合成gif图片.
Stars: ✭ 54 (+80%)
Mutual labels:  bitmap
FastBitmap
A fast C# Bitmap wrapping layer
Stars: ✭ 86 (+186.67%)
Mutual labels:  bitmap
BlueVGA
VGA library for STM32F103C (BluePill) that can manipulate a screen with 28x30 tiles with 8x8 pixels each, in a total resolution of 224x240 pixels with 8 colors using a very low footprint
Stars: ✭ 39 (+30%)
Mutual labels:  bitmap
ecs
Build your own Game-Engine based on the Entity Component System concept in Golang.
Stars: ✭ 68 (+126.67%)
Mutual labels:  bitset
ProminentColor
Android Library to get average/prominent color of bitmap/drawable
Stars: ✭ 23 (-23.33%)
Mutual labels:  bitmap
Doramon
个人工具汇总:一致性哈希工具,Bitmap工具,布隆过滤器参数生成器,Yaml和properties互转工具,一键式生成整个前后端工具,单机高性能幂等工具,zookeeper客户端工具,分布式全局id生成器,时间转换工具,Http封装工具
Stars: ✭ 53 (+76.67%)
Mutual labels:  bitmap
enumset
A library for compact bit sets containing enums.
Stars: ✭ 60 (+100%)
Mutual labels:  bitset
bitmap-sdf
Calculate SDF for image/bitmap/bw data
Stars: ✭ 25 (-16.67%)
Mutual labels:  bitmap
AvatarImageGenerator
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice
Stars: ✭ 61 (+103.33%)
Mutual labels:  bitmap
snowb-bmf
Bitmap Font Generator Online
Stars: ✭ 103 (+243.33%)
Mutual labels:  bitmap

Bitmap

In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits, that is, values which are zero or one. It is also called a bit array or bitmap index.

This is an Elixir implementation of a bit array. Two implementations are provided as part of the library, Binary and Integer. Integers are the default due to clear performance superiority based on benchmarks provided below.

It is a fast space efficient data structure for lookups.

Note: Index is zero based in the implementation

Examples

iex> bitmap = Bitmap.new(5)
<<0::size(5)>> # 00000
iex> Bitmap.set(bitmap, 2)
<<4::size(5)>> # 00100
iex> bitmap |> Bitmap.set(2) |> Bitmap.set(3)
<<6::size(5)>> # 00110
iex> bitmap |> Bitmap.set(2) |> Bitmap.set(3) |> Bitmap.unset(2)
<<2::size(5)>> # 00010

Read the latest documentation here for elaborate description and more examples on how to use the library.

Benchmark using Benchfella

Results are based on sources present inside the bench/ directory.

Bitmaps of size 1,000,000 are used to get benchmark on performance of the two implementations provided in the library - Binary and Integer.

Benchmark Bitmap.Integer.at           100000000   0.05 µs/op
Benchmark Bitmap.Integer.unset_all    100000000   0.06 µs/op
Benchmark Bitmap.Integer.set?         100000000   0.07 µs/op
Benchmark Bitmap.Integer.new           10000000   0.11 µs/op
Benchmark Bitmap.Integer.set             500000   7.50 µs/op
Benchmark Bitmap.Integer.toggle          500000   7.52 µs/op
Benchmark Bitmap.Integer.toggle_all      100000   21.33 µs/op
Benchmark Bitmap.Integer.unset           100000   22.83 µs/op
Benchmark Bitmap.Binary.unset_all         50000   74.54 µs/op
Benchmark Bitmap.Binary.new               20000   79.34 µs/op
Benchmark Bitmap.Binary.set?              20000   90.18 µs/op
Benchmark Bitmap.Binary.at                20000   99.70 µs/op
Benchmark Bitmap.Binary.toggle            10000   169.97 µs/op
Benchmark Bitmap.Binary.unset             10000   207.38 µs/op
Benchmark Bitmap.Binary.set               10000   208.58 µs/op
Benchmark Bitmap.Integer.set_all             10   111083.80 µs/op
Benchmark Bitmap.Binary.set_all              10   143833.10 µs/op
Benchmark Bitmap.Binary.to_string             1   80530194.00 µs/op
Benchmark Bitmap.Integer.to_string            1   89035291.00 µs/op
Benchmark Bitmap.Binary.toggle_all            1   451542225.00 µs/op
License

This project is available under MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].