Рет қаралды 498
In this Swift & iOS Basics episode, I explore the copy-on-write mechanism in Swift. Copy-on-write (CoW) can make value types’ memory usage more efficient by deferring the duplication of data or avoiding it altogether. But copy-on-write is not a silver bullet, and in this video, I explain the important considerations.
You can support the Swift Bird by…
• …becoming a regular sponsor: / swiftbird
• …buying me a coffee: www.buymeacoffee.com/SwiftBird
Links:
• The demo / tutorial code: gist.github.com/yakovmanshin/...
• Value and reference types in Swift: • Value & Reference Type...
• Swift & iOS Basics playlist: • Swift & iOS Basics
Chapters:
• 0:00 Intro
• 0:45 What It Does & When You May Want It
• 3:56 Pros & Cons of Copy-on-Write
• 7:09 Implementing CoW for Custom Types
• 13:53 Summary & Outro
The Swift Bird is produced by / yakovmanshin .
#copyonwrite #computermemory #softwareengineering