{"id":13599926,"url":"https://github.com/indexmap-rs/indexmap","last_synced_at":"2025-12-12T12:09:51.200Z","repository":{"id":37692832,"uuid":"68294628","full_name":"indexmap-rs/indexmap","owner":"indexmap-rs","description":"A hash table with consistent order and fast iteration; access items by key or sequence index","archived":false,"fork":false,"pushed_at":"2025-04-04T23:17:17.000Z","size":1034,"stargazers_count":1972,"open_issues_count":16,"forks_count":165,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-17T14:13:44.434Z","etag":null,"topics":["hashtable","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/indexmap/","language":"Rust","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/indexmap-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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-09-15T13:06:08.000Z","updated_at":"2025-04-17T13:24:01.000Z","dependencies_parsed_at":"2024-01-30T14:59:20.126Z","dependency_job_id":"92fd003a-6147-48ba-8122-009cbdf5f6eb","html_url":"https://github.com/indexmap-rs/indexmap","commit_stats":{"total_commits":664,"total_committers":45,"mean_commits":"14.755555555555556","dds":0.5647590361445782,"last_synced_commit":"31c9862f71e00411271acb7c9bea3a21b3d08880"},"previous_names":["bluss/ordermap","indexmap-rs/indexmap","bluss/indexmap"],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexmap-rs%2Findexmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexmap-rs%2Findexmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexmap-rs%2Findexmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexmap-rs%2Findexmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indexmap-rs","download_url":"https://codeload.github.com/indexmap-rs/indexmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250215003,"owners_count":21393707,"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":["hashtable","rust"],"created_at":"2024-08-01T17:01:19.146Z","updated_at":"2025-12-12T12:09:51.188Z","avatar_url":"https://github.com/indexmap-rs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# indexmap\n\n[![build status](https://github.com/indexmap-rs/indexmap/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/indexmap-rs/indexmap/actions)\n[![crates.io](https://img.shields.io/crates/v/indexmap.svg)](https://crates.io/crates/indexmap)\n[![docs](https://docs.rs/indexmap/badge.svg)](https://docs.rs/indexmap)\n[![rustc](https://img.shields.io/badge/rust-1.82%2B-orange.svg)](https://img.shields.io/badge/rust-1.82%2B-orange.svg)\n\nA pure-Rust hash table which preserves (in a limited sense) insertion order.\n\nThis crate implements compact map and set data-structures,\nwhere the iteration order of the keys is independent from their hash or\nvalue. It preserves insertion order (except after removals), and it\nallows lookup of entries by either hash table key or numerical index.\n\nNote: this crate was originally released under the name `ordermap`,\nbut it was renamed to `indexmap` to better reflect its features.\nThe [`ordermap`](https://crates.io/crates/ordermap) crate now exists\nas a wrapper over `indexmap` with stronger ordering properties.\n\n# Background\n\nThis was inspired by Python 3.6's new dict implementation (which remembers\nthe insertion order and is fast to iterate, and is compact in memory).\n\nSome of those features were translated to Rust, and some were not. The result\nwas indexmap, a hash table that has following properties:\n\n- Order is **independent of hash function** and hash values of keys.\n- Fast to iterate.\n- Indexed in compact space.\n- Preserves insertion order **as long** as you don't call `.remove()`,\n  `.swap_remove()`, or other methods that explicitly change order.\n  The alternate `.shift_remove()` does preserve relative order.\n- Uses hashbrown for the inner table, just like Rust's libstd `HashMap` does.\n\n## Performance\n\n`IndexMap` derives a couple of performance facts directly from how it is constructed,\nwhich is roughly:\n\n\u003e A raw hash table of key-value indices, and a vector of key-value pairs.\n\n- Iteration is very fast since it is on the dense key-values.\n- Removal is fast since it moves memory areas only in the table,\n  and uses a single swap in the vector.\n- Lookup is fast-ish because the initial 7-bit hash lookup uses SIMD, and indices are\n  densely stored. Lookup also is slow-ish since the actual key-value pairs are stored\n  separately. (Visible when cpu caches size is limiting.)\n\n- In practice, `IndexMap` has been tested out as the hashmap in rustc in [PR45282] and\n  the performance was roughly on par across the whole workload.\n- If you want the properties of `IndexMap`, or its strongest performance points\n  fits your workload, it might be the best hash table implementation.\n\n[PR45282]: https://github.com/rust-lang/rust/pull/45282\n\n# Recent Changes\n\nSee [RELEASES.md](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexmap-rs%2Findexmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findexmap-rs%2Findexmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexmap-rs%2Findexmap/lists"}