<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>CoW on Abhishek Shukla</title><link>https://abhishekshukla.dev/tags/cow/</link><description>Recent content in CoW on Abhishek Shukla</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 03 Mar 2026 13:47:17 +0530</lastBuildDate><atom:link href="https://abhishekshukla.dev/tags/cow/index.xml" rel="self" type="application/rss+xml"/><item><title>How Copy-on-Write(CoW) in Swift works and optimizes memory</title><link>https://abhishekshukla.dev/blog/copy-on-writecow/</link><pubDate>Tue, 03 Mar 2026 13:47:17 +0530</pubDate><guid>https://abhishekshukla.dev/blog/copy-on-writecow/</guid><description>&lt;p&gt;Swift is designed around two core principles: &lt;strong&gt;safety&lt;/strong&gt; and &lt;strong&gt;performance&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;At first glance, these goals often appear to conflict. Value types provide safety and predictability, but copying large values repeatedly can be expensive. Reference types provide efficiency through shared storage, but they introduce shared mutable state.&lt;/p&gt;
&lt;p&gt;Swift solves this tension elegantly through a memory optimization technique called &lt;strong&gt;Copy-on-Write (CoW).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you’ve used Array, Dictionary, Set, or String, you’ve already relied on Copy-on-Write — even if you didn’t realize it.&lt;/p&gt;</description></item></channel></rss>