{"id":13507160,"url":"https://github.com/hashd/bitmap-elixir","last_synced_at":"2025-03-16T07:32:18.656Z","repository":{"id":57479752,"uuid":"41974493","full_name":"hashd/bitmap-elixir","owner":"hashd","description":"Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups","archived":false,"fork":false,"pushed_at":"2018-01-03T08:52:49.000Z","size":26,"stargazers_count":36,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T05:50:59.450Z","etag":null,"topics":["bitmap","bitset","elixir","hex-package"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/bitmap","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-05T20:26:06.000Z","updated_at":"2024-10-13T16:44:01.000Z","dependencies_parsed_at":"2022-09-17T04:51:17.505Z","dependency_job_id":null,"html_url":"https://github.com/hashd/bitmap-elixir","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashd%2Fbitmap-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashd%2Fbitmap-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashd%2Fbitmap-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashd%2Fbitmap-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashd","download_url":"https://codeload.github.com/hashd/bitmap-elixir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806049,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitmap","bitset","elixir","hex-package"],"created_at":"2024-08-01T02:00:25.583Z","updated_at":"2025-03-16T07:32:18.337Z","avatar_url":"https://github.com/hashd.png","language":"Elixir","readme":"Bitmap\n======\n\nIn 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.\n\nThis 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.\n\nIt is a fast space efficient data structure for lookups.\n\n\u003e Note: Index is zero based in the implementation\n\n### Examples\n``` elixir\niex\u003e bitmap = Bitmap.new(5)\n\u003c\u003c0::size(5)\u003e\u003e # 00000\niex\u003e Bitmap.set(bitmap, 2)\n\u003c\u003c4::size(5)\u003e\u003e # 00100\niex\u003e bitmap |\u003e Bitmap.set(2) |\u003e Bitmap.set(3)\n\u003c\u003c6::size(5)\u003e\u003e # 00110\niex\u003e bitmap |\u003e Bitmap.set(2) |\u003e Bitmap.set(3) |\u003e Bitmap.unset(2)\n\u003c\u003c2::size(5)\u003e\u003e # 00010\n```\n\nRead the latest documentation [here](http://hexdocs.pm/bitmap/overview.html) for elaborate description and more examples on how to use the library.\n\n### Benchmark using `Benchfella`\nResults are based on sources present inside the `bench/` directory.\n\nBitmaps of size 1,000,000 are used to get benchmark on performance of the two\nimplementations provided in the library - Binary and Integer.\n```\nBenchmark Bitmap.Integer.at           100000000   0.05 µs/op\nBenchmark Bitmap.Integer.unset_all    100000000   0.06 µs/op\nBenchmark Bitmap.Integer.set?         100000000   0.07 µs/op\nBenchmark Bitmap.Integer.new           10000000   0.11 µs/op\nBenchmark Bitmap.Integer.set             500000   7.50 µs/op\nBenchmark Bitmap.Integer.toggle          500000   7.52 µs/op\nBenchmark Bitmap.Integer.toggle_all      100000   21.33 µs/op\nBenchmark Bitmap.Integer.unset           100000   22.83 µs/op\nBenchmark Bitmap.Binary.unset_all         50000   74.54 µs/op\nBenchmark Bitmap.Binary.new               20000   79.34 µs/op\nBenchmark Bitmap.Binary.set?              20000   90.18 µs/op\nBenchmark Bitmap.Binary.at                20000   99.70 µs/op\nBenchmark Bitmap.Binary.toggle            10000   169.97 µs/op\nBenchmark Bitmap.Binary.unset             10000   207.38 µs/op\nBenchmark Bitmap.Binary.set               10000   208.58 µs/op\nBenchmark Bitmap.Integer.set_all             10   111083.80 µs/op\nBenchmark Bitmap.Binary.set_all              10   143833.10 µs/op\nBenchmark Bitmap.Binary.to_string             1   80530194.00 µs/op\nBenchmark Bitmap.Integer.to_string            1   89035291.00 µs/op\nBenchmark Bitmap.Binary.toggle_all            1   451542225.00 µs/op\n```\n\n##### License\nThis project is available under MIT License.\n","funding_links":[],"categories":["Algorithms and Data structures"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashd%2Fbitmap-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashd%2Fbitmap-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashd%2Fbitmap-elixir/lists"}