<div dir="ltr">Thanks, I will give that a try</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"> -- Howard.<br></div></div>
<br><div class="gmail_quote">On 24 March 2016 at 03:17, Jens Alfke <span dir="ltr"><<a href="mailto:jens@mooseyard.com" target="_blank">jens@mooseyard.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Mar 22, 2016, at 11:04 PM, Howard Lovatt via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I am writing custom collection classes and trying to assess which one is better, both in terms of performance and memory usage. Won't be used in 'real' code, just to guide development.</div></div></blockquote></div><br><div>You might consider using heap profiling tools too, like (on Mac OS) the Instruments app or the `heap` command-line tool. If you use these while running a benchmark app using your API, it can show you how much total heap space gets used.</div><div><br></div><div>Actual heap usage can differ from the raw “sizeof” a data type, since allocators will often round up block sizes or return a somewhat larger block than necessary. Heap fragmentation can also increase memory usage beyond what you’d expect, and different allocation patterns can affect fragmentation.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>—Jens</div></font></span></div></blockquote></div><br></div>