apple/swift-collections

Commonly used data structures for Swift

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 45 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 15th, 2026
Created on February 15th, 2021
Open Issues & Pull Requests: 75 (+0)
GitHub issues: Enabled
Number of forks: 407
Total Stargazers: 4,502 (+0)
Total Subscribers: 148 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.4 days
Mean response time: 86.5 days
90th percentile: 151.7 days
Tracked items: 50

Most active contributors

Sign in to see contributor activity.

How this project is maintained

54% of open issues come from outside the core team, a mix of external reports and the maintainers' own roadmap. Three people close 89% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 24
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 825 days
Stale 30+ days: 24
Stale 90+ days: 22

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (27)
  • enhancement (26)
  • SortedCollections (4)
  • BitCollections (2)
  • Heap (2)
  • api-redesign (1)
  • documentation (1)
  • good first issue (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Swift Collections is a package of data structure implementations for the Swift programming language.

The package addresses the need for specialized collection types beyond Swift's standard library offerings. It provides ownership-aware variants like UniqueArray and RigidArray with different memory management strategies, double-ended queue implementations using ring buffers in both copyable and noncopyable forms, and ordered variants of Set and Dictionary that preserve insertion order. The package also includes efficient bit-level collections for representing sets of integers and boolean arrays, a min-max heap suitable for priority queues, and hash tree-based collections. These implementations are organized into thematic modules, allowing developers to import only the data structures they need.

Developers should adopt this package when their applications require collection types with specific performance characteristics or ordering guarantees not provided by the standard library. Projects that need to preserve insertion order in sets or dictionaries, require fixed-capacity or uniquely-held array variants, or benefit from specialized structures like deques or bit sets are good candidates. The package distinguishes itself by offering multiple variants of similar concepts—such as Deque, UniqueDeque, and RigidDeque—each optimized for different ownership and capacity models, giving developers fine-grained control over memory behavior.

The project maintains a clear separation between stable data structures and experimental features. Stable implementations are organized across modules including BasicContainers, DequeModule, OrderedCollections, BitCollections, HeapModule, and HashTreeCollections. Experimental features are available through package traits, allowing developers to opt into preview functionality for unstable containers, hashed containers, and sorted collections. The project defines a public API contract and specifies minimum Swift toolchain version requirements. Contribution guidelines distinguish between bug fixes, small enhancements, and proposals for new data structures, with a documented branching strategy for development.