<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Exactly.&nbsp;<br><br><div>Sent from my moss-covered three-handled family gradunza</div></div><div><br>On Feb 24, 2017, at 9:49 AM, David Sweeris &lt;<a href="mailto:davesweeris@mac.com">davesweeris@mac.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 23, 2017, at 4:04 PM, Ted F.A. van Gaalen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><font size="4" class=""><br class=""></font><div class=""><blockquote type="cite" class=""><div class="">On 23 Feb 2017, at 02:24, Dave Abrahams &lt;<a href="mailto:dabrahams@apple.com" class="">dabrahams@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">Equally a non-starter. All known threadsafe schemes that require caches to be updated upon non-mutating operations have horrible performance issues, and further this would penalize all string code by reserving space for the cache and filling it even for the vast majority of operations that don't require random access. </div></div></div></blockquote><div class="">Well, maybe “caching” is not the right description for what I've suggested.</div><div class="">It is more like:</div><div class="">&nbsp; let all strings be stored as they are now, but as soon as you want to work with&nbsp;</div><div class="">random accessing parts of a string just&nbsp;“lift the string out of normal optimised string storage”&nbsp;</div><div class="">&nbsp;and then add (temporarily) &nbsp;a Character array so one can work with this array directly ”&nbsp;</div><div class="">which implies that all other strings remain as they are. &nbsp;ergo: efficiency&nbsp;</div><div class="">is only reduced for the&nbsp;“elevated” strings,</div><div class="">Using e.g. str.freeSpace(), if necessary, would then place the String back&nbsp;</div><div class="">in its normal storage domain, thereby disposing the Character array</div><div class="">associated with it.&nbsp;</div></div></div></div></blockquote><br class=""></div><div>Wouldn’t that turn simple character access into a mutating function?</div><div><br class=""></div><div>- Dave Sweeris</div></div></blockquote></body></html>