Repository navigation
Conversation
The library compiles to nothing on the host, where package-benchmark runs. Measured on an iPhone simulator instead: the library adds about 16 us to a 100 us render of eight variations, so there is no hot path to improve.
This was referenced Nov 14, 2026
Owner
Author
|
Superseded by #12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #8 (base
chore/architecture-rules); merge #8 first and GitHub retargets this tomain.Why no
Benchmarks/packagepackage-benchmark runs a host executable (macOS/Linux). Every file in this library is wrapped in
#if targetEnvironment(simulator), so on the host the module is empty and there is nothing for a benchmark to call; package-benchmark cannot run inside the iOS simulator. Rather than invent a benchmark,docs/performance.mdrecords what the library actually costs where it runs.Measured on an iPhone 17 simulator (iOS 27, Debug, p50)
EnvironmentValueItemListof 8 items.environmentVariations(value construction)UIHostingControllerTexts, no libraryThe library adds ~16 µs to a ~100 µs SwiftUI render inside a preview canvas that spends milliseconds around it. No library change was made: none would be measurable by a user, so there is no before → after table and no release.
The doc also notes one deliberate non-change:
HashableEnvironmentValueItemmakes a freshUUIDper list build, so variations get new identities when a parent re-renders. Stabilising it changes the publicid/Hashablesemantics, so it is a behaviour change, not a perf patch.