{"id":20004945,"url":"https://github.com/lemonmojo/swiftui-hierarchical-list-performance","last_synced_at":"2025-09-20T01:32:01.099Z","repository":{"id":251895812,"uuid":"838698232","full_name":"lemonmojo/swiftui-hierarchical-list-performance","owner":"lemonmojo","description":"This is a demo project that highlights performance issues with hierarchical SwiftUI lists.","archived":false,"fork":false,"pushed_at":"2024-08-20T07:49:05.000Z","size":19,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T04:29:45.179Z","etag":null,"topics":["ios","macos","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemonmojo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-06T07:02:49.000Z","updated_at":"2024-09-23T03:42:52.000Z","dependencies_parsed_at":"2024-11-13T05:37:23.193Z","dependency_job_id":"85b0e9cd-7b93-4e27-8b83-36342b858df5","html_url":"https://github.com/lemonmojo/swiftui-hierarchical-list-performance","commit_stats":null,"previous_names":["lemonmojo/swiftui-hierarchical-list-performance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemonmojo%2Fswiftui-hierarchical-list-performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemonmojo%2Fswiftui-hierarchical-list-performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemonmojo%2Fswiftui-hierarchical-list-performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemonmojo%2Fswiftui-hierarchical-list-performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemonmojo","download_url":"https://codeload.github.com/lemonmojo/swiftui-hierarchical-list-performance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233611242,"owners_count":18702479,"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":["ios","macos","swiftui"],"created_at":"2024-11-13T05:37:14.426Z","updated_at":"2025-09-20T01:32:01.029Z","avatar_url":"https://github.com/lemonmojo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftUI Hierarchical List Performance\n\nThis is a demo project that highlights performance issues with [hierarchical SwiftUI lists](https://developer.apple.com/documentation/swiftui/list#Creating-hierarchical-lists).\n\nThere are three main problems:\n\n1. Rendering of the list is slow if there are many items. (Just start the app and wait for the list to be rendered.)\n2. Changing the selected item is very slow. (Tap/Click an item and wait for the selection to change.)\n3. Updating the list is slow. (Press the \"Shuffle\" button.)\n\nOn an iPhone 13 Pro, it takes 6 seconds from tapping the app icon to the list being rendered. This was timed with a release build.\nOnce the list has been rendered, it takes 8 seconds for the selection to change when tapping an item.\nTapping the \"Shuffle\" button results in a 2 seconds delay before the updated list is rendered.\n\nAll three problems are much more pronounced on macOS (tested on a Mac Studio M2) where it even takes minutes(!) for the app to become responsive.\n\nInstruments shows that 99% of the CPU time is spent somewhere deep inside SwiftUI.\nVarious attempts have been made to fix the problems (as documented in the code) but none of them have been successful.\n\nThere are two different data sets included in the demo. One can switch between them by commenting out one of the `let rootItem …` declarations and commenting in the other in `ContentView.swift`.\nThe default example has a flat list with 100.000 items. The \"real-world\" example has 4 folders, each containing 25.000 items which is faster to render initially, but as soon as you start expanding folders it's slow again.\n\nSee [this repo](https://github.com/lemonmojo/appkit-hierarchical-list-performance) for an implementation using AppKit's `NSOutlineView` and [this repo](https://github.com/lemonmojo/uikit-hierarchical-list-performance) for an implementation using UIKit's `UICollectionView` where everything is blazing fast using the same data set.\n\n## Update June 10 2025\n\nDespite WWDC 25 announcements of much improved SwiftUI List performance, hierarchical lists, or at least the kind of list in this sample project are still slow on both iOS and macOS 26 beta 1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonmojo%2Fswiftui-hierarchical-list-performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemonmojo%2Fswiftui-hierarchical-list-performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonmojo%2Fswiftui-hierarchical-list-performance/lists"}