[SR-11762] Property wrappers can cause surprising value copying #54169
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
performance
property wrappers
Feature: property wrappers
Additional Detail from JIRA
md5: 7d1996ac6ea6804b72c35b1c7acad619
Issue Description:
I have a property wrapper on an array property. For example:
Running this code is very slow (in both release and debug modes) as it causes something like 20,000 array copies to occur. If I remove the property wrapper, it runs very fast and has no array copying overhead. This is very unexpected behavior, IMO, and represents a rather nasty performance surprise when using property wrappers.
I originally posted about this on the forums here: https://forums.swift.org/t/property-wrapper-causing-excessive-array-copying/30637
Tested on Xcode 11.2.1 (11B53).
The text was updated successfully, but these errors were encountered: