{"id":13546762,"url":"https://github.com/usethesource/capsule","last_synced_at":"2025-04-05T17:09:44.451Z","repository":{"id":1889185,"uuid":"44677217","full_name":"usethesource/capsule","owner":"usethesource","description":"The Capsule Hash Trie Collections Library","archived":false,"fork":false,"pushed_at":"2023-10-02T12:57:10.000Z","size":4694,"stargazers_count":406,"open_issues_count":9,"forks_count":27,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-03-29T16:11:08.443Z","etag":null,"topics":["hashmap","hashset","immutable","immutable-collections","java","performance","persistent-data-structure","trie"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usethesource.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}},"created_at":"2015-10-21T13:13:26.000Z","updated_at":"2025-01-23T21:45:20.000Z","dependencies_parsed_at":"2024-01-27T11:11:40.629Z","dependency_job_id":"9ac05e63-935c-424c-9df9-de361a28b419","html_url":"https://github.com/usethesource/capsule","commit_stats":{"total_commits":437,"total_committers":10,"mean_commits":43.7,"dds":0.7070938215102975,"last_synced_commit":"3856cd65fa4735c94bcfa94ec9ecf408429b54f4"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usethesource%2Fcapsule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usethesource%2Fcapsule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usethesource%2Fcapsule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usethesource%2Fcapsule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usethesource","download_url":"https://codeload.github.com/usethesource/capsule/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369954,"owners_count":20927928,"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":["hashmap","hashset","immutable","immutable-collections","java","performance","persistent-data-structure","trie"],"created_at":"2024-08-01T12:00:44.509Z","updated_at":"2025-04-05T17:09:44.427Z","avatar_url":"https://github.com/usethesource.png","language":"Java","readme":"# The Capsule Hash Trie Collections Library\n\n## Status\n\n![capsule build status](https://github.com/usethesource/capsule/actions/workflows/build.yaml/badge.svg)\n\n## Synopsis\n\nCapsule aims to become a full-fledged (immutable) collections library for Java 11+ that is solely built around persistent tries. The library is designed for standalone use and for being embedded in domain-specific languages. Capsule still has to undergo some incubation before it can ship as a well-rounded collection library. Nevertheless, the code is stable and performance is solid. Feel free to use it and let us know about your experiences!\n\n# Getting Started\n\nBinary builds of Capsule are deployed in the usethesource repository. In case you use Maven for dependency management, you have to add another repository location to your pom.xml file:\n\n```\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003eusethesource\u003c/id\u003e\n    \u003curl\u003ehttps://releases.usethesource.io/maven/\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nFurthermore, you have to declare Capsule as a dependency.\n\nTo obtain the latest release for Java 11+, insert the following snippet in your `pom.xml` file:\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.usethesource\u003c/groupId\u003e\n  \u003cartifactId\u003ecapsule\u003c/artifactId\u003e\n  \u003cversion\u003e0.7.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo obtain the latest available version for Java 8, insert the following snippet in your `pom.xml` file:\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.usethesource\u003c/groupId\u003e\n  \u003cartifactId\u003ecapsule\u003c/artifactId\u003e\n  \u003cversion\u003e0.6.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nSnippets for other build tools and dependency management systems may vary slightly.\n\n## Exploring Capsule\n\nBuild the library and spawn a Java shell to interactively explore Capsule, e.g.:\n\n```shell\n$ ./gradlew clean build\n$ jshell --class-path ./build/libs/capsule-*-SNAPSHOT.jar\n\n|  Welcome to JShell\n|  For an introduction type: /help intro\n\njshell\u003e var set = io.usethesource.capsule.Set.Immutable.of(1, 2);\nset ==\u003e {1, 2}\n```\n\n# Background: Efficient Immutable Data Structures on the JVM\nThe standard libraries of recent Java Virtual Machine languages, such as Clojure or Scala, contain scalable and well-performing immutable collection data structures that are implemented as Hash-Array Mapped Tries (HAMTs). HAMTs already feature efficient lookup, insert, and delete operations, however due to their tree-based nature their memory footprints and the runtime performance of iteration and equality checking lag behind array-based counterparts.\n\nWe introduce CHAMP (Compressed Hash-Array Mapped Prefix-tree), an evolutionary improvement over HAMTs. The new design increases the overall performance of immutable sets and maps. Furthermore, its resulting general purpose design increases cache locality and features a canonical representation.\n\n# References and Further Readings\n\n## Talks\n* [JVM Language Summit 2016 - Efficient and Expressive Immutable Collections (Speaker: Michael Steindorfer)](https://www.youtube.com/watch?v=pUXeNAeyY34)\n* [JVM Language Summit 2017 - Lightweight Relations (Speaker: Michael Steindorfer)](https://www.youtube.com/watch?v=D8Y294vHdqI)\n* [Clojure/west 2016 - Hash Maps: More Room on the Bottom (Speaker: Peter Schuck)](https://www.youtube.com/watch?v=GibNOQVelFY)\n\n## Publications\n* [PhD Thesis: Efficient Immutable Collections (2017)](https://michael.steindorfer.name/publications/phd-thesis-efficient-immutable-collections)\n* [Paper: Optimizing Hash-Array Mapped Tries for Fast and Lean Immutable JVM Collections (OOPSLA 2015)](https://michael.steindorfer.name/publications/oopsla15.pdf)\n* [Paper: To-Many or To-One? All-in-One! Efficient Purely Functional Multi-maps with Type-Heterogeneous Hash-Tries (PLDI 2018)](https://michael.steindorfer.name/publications/pldi18.pdf)\n* [Paper: Towards a Software Product Line of Trie-Based Collections (Short Paper, GPCE 2016)](https://michael.steindorfer.name/publications/gpce16.pdf)\n* [Paper: Code Specialization for Memory Efficient Hash Tries (Short Paper, GPCE 2014)](https://michael.steindorfer.name/publications/gpce14.pdf)\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusethesource%2Fcapsule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusethesource%2Fcapsule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusethesource%2Fcapsule/lists"}