<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><blockquote type="cite" class="">On Dec 6, 2015, at 5:16 PM, Karl Pickett via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:<br class=""><br class="">When I use an inout param, that is 2x as fast and doesn't re-initialize each time.&nbsp;&nbsp;However I don't see why passing something immutably wouldn't be as fast.<br class=""></blockquote><br class=""><div class="">Huh. That’s especially weird since the semantics of inout actually call for <i class="">two</i>&nbsp;copies (after the called function returns, the copy of the struct that was passed to it gets copied back into the original variable.) The compiler is often able to optimize that down to the more-expected pass-by-pointer, as in your example. So why then isn’t it able to optimize the non-inout case the same way?</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>