[SR-14062] Array copy on write triggered unnecessarily #56451
Labels
Array
Area → standard library: The `Array` type
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
COW
Feature: Copy-On-Write support
performance
standard library
Area: Standard library umbrella
Environment
MacOS: 10.15.7 (19H114)
Xcode: Version 12.3 (12C33)
Additional Detail from JIRA
md5: 63b050d6dfe63db61b5377327e1483ab
Issue Description:
From: https://forums.swift.org/t/why-is-array-copy-on-write-getting-triggered-in-this-code/43914
Profiling this gives:
Note that the buggy version takes 6.27 seconds on my machine, and the workaround takes 1 ms.
Filed with Feedback Assistant as: FB8972901
The text was updated successfully, but these errors were encountered: