Closed KeithBauerANZ closed 1 year ago
https://forums.swift.org/t/add-shared-storage-to-property-wrappers/49898 might allow for a better solution in the future, but for now, this is the best option I can see!
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
1 Code Smell
No Coverage information
0.0% Duplication
📒 Description
A few hundred flags in some nested groups could easily generate a few MB of code for their init/deinit/copy functions. By reducing the stored properties in Flag/FlagGroup to a minimum, we can reduce this bloat to a minimum. By inlining
Decorator
, the number of heap allocations can remain constant.🔍 Detailed Design
Entirely API-compatible change (though IMO it could be improved by making some more Flag/FlagGroup properties read-only, and avoiding the need for
isKnownUniquelyReferenced
)📓 Documentation Plan
Entirely API-compatible change
🗳 Test Plan
Entirely API-compatible change. Existing tests pass.
🧯 Source Impact
None
✅ Checklist