{"id":19407635,"url":"https://github.com/gossiperloturot/densemap","last_synced_at":"2026-01-31T07:03:07.375Z","repository":{"id":194573031,"uuid":"689348300","full_name":"GossiperLoturot/densemap","owner":"GossiperLoturot","description":"A collection data structure that is permanently accessible by unique keys and fast iterable","archived":false,"fork":false,"pushed_at":"2024-07-22T13:42:46.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T10:52:04.784Z","etag":null,"topics":["data-structures","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/GossiperLoturot.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":"2023-09-09T14:23:07.000Z","updated_at":"2025-03-24T17:36:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"df972ff2-7271-4bc8-a1f8-912be1a2d008","html_url":"https://github.com/GossiperLoturot/densemap","commit_stats":null,"previous_names":["gossiperloturot/densemap"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/GossiperLoturot/densemap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GossiperLoturot%2Fdensemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GossiperLoturot%2Fdensemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GossiperLoturot%2Fdensemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GossiperLoturot%2Fdensemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GossiperLoturot","download_url":"https://codeload.github.com/GossiperLoturot/densemap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GossiperLoturot%2Fdensemap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28932599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-structures","rust"],"created_at":"2024-11-10T12:03:20.250Z","updated_at":"2026-01-31T07:03:07.354Z","avatar_url":"https://github.com/GossiperLoturot.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# densemap\n\n![Crates.io](https://img.shields.io/crates/v/densemap)\n![Crates.io](https://img.shields.io/crates/l/densemap)\n\n[**Documentation**](https://docs.rs/densemap)\n\nThis library provides a collection `DenseMap` that are permanently accessible by unique keys and fast\niterable. A key is generated upon insertion and can be used to access any element. Inserts,\nremoves, and gets run in constant time, and iteration has the same performance as `Vec`. Also\n`DenseMap` reduces memory usage by reusing removed areas.\n\n# Examples\n\n```rust\nuse densemap::{DenseMap, Key};\n\n// Creates a new dense map and inserts some elements.\nlet mut densemap = DenseMap::new();\nlet key_of_alice = densemap.insert(\"alice\");\nlet key_of_bob = densemap.insert(\"bob\");\n\n// Gets an element.\nassert_eq!(densemap.get(key_of_alice), Some(\u0026\"alice\"));\n\n// Removes an element.\nassert_eq!(densemap.remove(key_of_alice), Some(\"alice\"));\nlet key_of_charlie = densemap.insert(\"charlie\");\n\n// Keys are unique and permanently accessible.\nassert_eq!(densemap.get(key_of_alice), None);\n\n// Iterates all elements.\nfor value in densemap.values() {\n    println!(\"{value}\");\n}\n```\n\n# Differences from other libraries\n\nThis library is similar to `slotmap::DenseSlotMap`, but it has some differences.\n`DenseMap` has a performance advantage due to reduced overhead. Also this library simply provides\nonly a collection `DenseMap`.\n\n# Benchmarks\n\nThe performance measurement results for inserts, removes, reinserts, and iterates on the\ncollections of `std-1.72.1`. `slab-0.4.9`, `slotmap-1.0.6`, and `densemap-0.1.0` are shown\nbelow table. The results are measured by using `criterion` on WSL.\n\n| collection | insertion | removal | reinsertion | iteration |\n|:----------:|:---------:|:-------:|:-----------:|:---------:|\n| std::vec::Vec | 16.367 | 7.0338μs | 10.438μs | 3.6754μs |\n| std::collections::HashMap | 351.25μs | 187.99μs | 174.97μs | 14.617μs |\n| slab::Slab | 17.728μs | 17.952μs | 26.207μs | 4.9409μs |\n| slotmap::SlotMap | 49.043μs | 29.594μs | 48.153μs | 22.566μs |\n| slotmap::HopSlotMap | 46.897μs | 126.29μs | 67.884μs | 24.349μs |\n| slotmap::DenseSlotMap | 63.195μs | 62.308μs | 67.072μs | 5.2833μs |\n| densemap::DenseMap | 40.357μs | 24.969μs | 47.280μs | 3.6269μs |\n\n# License\n\nThis library is licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgossiperloturot%2Fdensemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgossiperloturot%2Fdensemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgossiperloturot%2Fdensemap/lists"}