# apple/swift-collections

Commonly used data structures for Swift

Repository: https://github.com/apple/swift-collections
Canonical: https://ross.abutalabs.com/products/swift-collections
Language: Swift
License: Apache-2.0
License Family: permissive
Topics: collection, container, deque, dequeue, hash, ordered-dictionary, ordered-set, sequence, queue
Last push: 2026-08-25T21:03:00+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 75, longevity 100
- inputs: {"age_days": 2025, "days_push": 8, "days_rel": 86, "gap_med": 33.5, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4481, forks 403 (observed 2026-08-28T04:08:51.145352+00:00)

## What it is
An open-source Swift package from Apple providing implementations of commonly used data structures such as deques, ordered sets, ordered dictionaries, heaps, bit collections, and hash-based tree collections. It extends the Swift standard library with production-quality, generic container types organized into thematic modules.

## Use cases
- need a deque or double-ended queue in Swift
- want an ordered set or ordered dictionary preserving insertion order
- need a priority queue or heap implementation
- require a fixed-capacity or uniquely-owned array type
- looking for a sorted or tree-backed dictionary in Swift
- need efficient bit set collections

## When to choose
- you are writing Swift and need data structures missing from the standard library
- you want Apple-maintained, well-tested collection implementations
- you need performance-optimized generic containers via Swift Package Manager

## When to avoid
- your project is not in Swift
- the standard library's Array, Set, and Dictionary already meet your needs
- you need highly specialized structures not offered by the package

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools, programming-languages
- platform: cross-platform
- tags: data-structures, collections, deque, ordered-dictionary, ordered-set, heap, bitset, swift-package, algorithms, swift

## Member repositories
- apple/swift-collections (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:51.145352+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:32.952024+00:00, confidence not recorded.
  - readme: https://github.com/apple/swift-collections (fetched 2026-08-28T04:08:51.145352+00:00, sha ae5a65ed6496)
- Data as of 2026-08-30T08:39:29.467469+00:00.
