{"id":19151961,"url":"https://github.com/roaringbitmap/gocroaring","last_synced_at":"2025-06-22T20:36:23.169Z","repository":{"id":49896389,"uuid":"65330923","full_name":"RoaringBitmap/gocroaring","owner":"RoaringBitmap","description":"Go wrapper for CRoaring","archived":false,"fork":false,"pushed_at":"2023-05-16T18:54:05.000Z","size":1327,"stargazers_count":46,"open_issues_count":0,"forks_count":10,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-31T06:51:10.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://roaringbitmap.org/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RoaringBitmap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-09T21:55:18.000Z","updated_at":"2024-12-01T13:27:39.000Z","dependencies_parsed_at":"2024-06-18T17:00:33.097Z","dependency_job_id":"585580a6-3fa6-4a95-b3ac-aceb82aecb73","html_url":"https://github.com/RoaringBitmap/gocroaring","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoaringBitmap%2Fgocroaring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoaringBitmap%2Fgocroaring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoaringBitmap%2Fgocroaring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoaringBitmap%2Fgocroaring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoaringBitmap","download_url":"https://codeload.github.com/RoaringBitmap/gocroaring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249738799,"owners_count":21318503,"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":[],"created_at":"2024-11-09T08:16:10.690Z","updated_at":"2025-04-19T16:32:08.783Z","avatar_url":"https://github.com/RoaringBitmap.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gocroaring   [![GoDoc](https://godoc.org/github.com/RoaringBitmap/gocroaring?status.svg)](https://godoc.org/github.com/RoaringBitmap/gocroaring) ![Tests (Ubuntu, macOS)](https://github.com/RoaringBitmap/gocroaring/workflows/Tests%20(Ubuntu,%20macOS)/badge.svg)\n\nWell-tested Go wrapper for [CRoaring](https://github.com/RoaringBitmap/CRoaring) (a C/C++ implementation of Roaring Bitmaps)\n\nRoaring bitmaps are used by several important systems:\n\n*   [Apache Lucene](http://lucene.apache.org/core/) and derivative systems such as Solr and [Elastic](https://www.elastic.co/),\n*   Metamarkets' [Druid](http://druid.io/),\n*   [Apache Spark](http://spark.apache.org),\n*   [Netflix Atlas](https://github.com/Netflix/atlas),\n*   [LinkedIn Pinot](https://github.com/linkedin/pinot/wiki),\n*   [OpenSearchServer](http://www.opensearchserver.com),\n*   [Cloud Torrent](https://github.com/jpillora/cloud-torrent),\n*   [Whoosh](https://pypi.python.org/pypi/Whoosh/),\n*   [Pilosa](https://www.pilosa.com/),\n*   [Microsoft Visual Studio Team Services (VSTS)](https://www.visualstudio.com/team-services/),\n*   eBay's [Apache Kylin](http://kylin.io).\n\nRoaring bitmaps are found to work well in many important applications:\n\n\u003e Use Roaring for bitmap compression whenever possible. Do not use other bitmap compression methods ([Wang et al., SIGMOD 2017](http://db.ucsd.edu/wp-content/uploads/2017/03/sidm338-wangA.pdf))\n\n\nThe original java version can be found at https://github.com/RoaringBitmap/RoaringBitmap\n\nThere is a native Go version at https://github.com/RoaringBitmap/roaring\n\n\nThis code is licensed under Apache License, Version 2.0 (ASL2.0).\n\nCopyright 2016 by the authors.\n\n\n### Benchmarking\n\nSee https://github.com/lemire/gobitmapbenchmark for a comparison between this wrapper and the Go native version.\n\n### References\n\n-  Daniel Lemire, Owen Kaser, Nathan Kurz, Luca Deri, Chris O'Hara, François Saint-Jacques, Gregory Ssi-Yan-Kai, Roaring Bitmaps: Implementation of an Optimized Software Library [arXiv:1709.07821](https://arxiv.org/abs/1709.07821)\n-  Samy Chambi, Daniel Lemire, Owen Kaser, Robert Godin,\nBetter bitmap performance with Roaring bitmaps,\nSoftware: Practice and Experience Volume 46, Issue 5, pages 709–719, May 2016\nhttp://arxiv.org/abs/1402.6407 This paper used data from http://lemire.me/data/realroaring2014.html\n- Daniel Lemire, Gregory Ssi-Yan-Kai, Owen Kaser, Consistently faster and smaller compressed bitmaps with Roaring, Software: Practice and Experience (accepted in 2016, to appear) http://arxiv.org/abs/1603.06549\n\n\n\n### Dependencies\n\nNone in particular.\n\nNaturally, you also need to grab the roaring code itself:\n  - go get github.com/RoaringBitmap/gocroaring\n\n\n### Example\n\nHere is a simplified but complete example:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/RoaringBitmap/gocroaring\"\n)\n\nfunc main() {\n\t// example inspired by https://github.com/fzandona/goroar\n\tfmt.Println(\"==roaring==\")\n\trb1 := gocroaring.New(1, 2, 3, 4, 5, 100, 1000)\n\trb1.RunOptimize() // improves compression\n\tfmt.Println(\"Cardinality: \", rb1.Cardinality())\n\tfmt.Println(\"Contains 3? \", rb1.Contains(3))\n\n\trb2 := gocroaring.New()\n\trb2.Add(3, 4, 1000)\n\trb2.RunOptimize() // improves compression\n\n\trb1.And(rb2)\n\t// prints {3,4,1000}\n\tfmt.Println(rb1)\n\n\trb3 := gocroaring.New(1, 5)\n\trb3.Or(rb1)\n\n        // prints 1, 3, 4, 5, 1000\n        i := rb3.Iterator()\n        for i.HasNext() {\n          fmt.Println(i.Next())\n        }\n        fmt.Println()\n\n\tfmt.Println(rb3.ToArray())\n\tfmt.Println(rb3)\n\n\trb4 := gocroaring.FastOr(rb1, rb2, rb3) // optimized way to compute unions between many bitmaps\n\tfmt.Println(rb4)\n\n\t// next we include an example of serialization\n\tbuf := make([]byte, rb1.SerializedSizeInBytes())\n\trb1.Write(buf) // we omit error handling\n\tnewrb, _ := gocroaring.Read(buf)\n\tif rb1.Equals(newrb) {\n\t\tfmt.Println(\"I wrote the content to a byte stream and read it back.\")\n\t}\n\n\tfmt.Println(rb1.Stats()) // show the cardinality and the numbers of each type of container used.\n}\n```\n\n### Documentation\n\nCurrent documentation is available at http://godoc.org/github.com/RoaringBitmap/gocroaring\n\n\n### Mailing list/discussion group\n\nhttps://groups.google.com/forum/#!forum/roaring-bitmaps\n\n### Compatibility with Java RoaringBitmap library\n\nYou can read bitmaps in Go, Java, C, C++ that have been serialized in Go, Java, C, C++.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froaringbitmap%2Fgocroaring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froaringbitmap%2Fgocroaring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froaringbitmap%2Fgocroaring/lists"}