<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/"

	>
<channel>
	<title>
	Comments on: Swift&#8217;s native Clocks are very inefficient	</title>
	<atom:link href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/feed/" rel="self" type="application/rss+xml" />
	<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2024 15:24:24 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Marcel		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3794</link>

		<dc:creator><![CDATA[Marcel]]></dc:creator>
		<pubDate>Wed, 08 May 2024 14:21:41 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3794</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3791&quot;&gt;Wade Tregaskis&lt;/a&gt;.

Yes, that was the discussion, but what I meant was Apple&#039;s own implementation, which is significantly slower than Brian&#039;s.  

Highly variable, unexpected, and difficult-to-influence performance problems are pretty much Swift&#039;s middle name.  As a long time performance engineer, my take has always been that Swift&#039;s approach is pretty much precisely the opposite of what you need to get good performance, never mind excellent performance.  So far, the results in the field seem to bear that out.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3791" data-wpel-link="internal">Wade Tregaskis</a>.</p>
<p>Yes, that was the discussion, but what I meant was Apple&#8217;s own implementation, which is significantly slower than Brian&#8217;s.  </p>
<p>Highly variable, unexpected, and difficult-to-influence performance problems are pretty much Swift&#8217;s middle name.  As a long time performance engineer, my take has always been that Swift&#8217;s approach is pretty much precisely the opposite of what you need to get good performance, never mind excellent performance.  So far, the results in the field seem to bear that out.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wade Tregaskis		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3791</link>

		<dc:creator><![CDATA[Wade Tregaskis]]></dc:creator>
		<pubDate>Tue, 07 May 2024 15:29:49 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3791</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3790&quot;&gt;Marcel&lt;/a&gt;.

If you mean &lt;a href=&quot;https://github.com/gh123man&quot; rel=&quot;nofollow ugc&quot;&gt;Brian Floersch&lt;/a&gt;&#039;s &lt;a href=&quot;https://github.com/gh123man/Async-Channels&quot; rel=&quot;nofollow ugc&quot;&gt;Async-Channels&lt;/a&gt; package, check out &lt;a href=&quot;https://forums.swift.org/t/async-channels-for-swift-concurrency/70752&quot; rel=&quot;nofollow ugc&quot;&gt;the discussion about and optimisation of it&lt;/a&gt;.

In short, the problems there are largely similar to the ones here with the clocks: Generics-using code not being specialised and inlined correctly.  I was able to show - &lt;a href=&quot;https://forums.swift.org/t/async-channels-for-swift-concurrency/70752/18&quot; rel=&quot;nofollow ugc&quot;&gt;details in the aforementioned Swift Forums thread&lt;/a&gt; - that if the compiler were to properly specialise Brian&#039;s channels code then the performance actually is competitive with Go.  Unfortunately no one has been able to figure out how to actually make it do that (short of copy-pasting the code into every module that uses it). 😕

Swift has the unusual ability, amongst languages with Generics, of ABI compatible implementations where the types used in the generics aren&#039;t known at compile time (and &quot;generics&quot; here encompasses protocols, too).  That&#039;s super powerful - it&#039;s what lets you use generics freely in dynamic libraries (from a functional sense, at least) and lets you use generics without forcing you to expose all your source code.  It&#039;s worth noting that those are pretty cool benefits.

But, alas, there is a potential downside, which is unexpected performance problems (and perhaps more critically, highly variable performance depending on subtle contextual factors like whether you&#039;re crossing a module boundary, and how the compiler is feeling right at that nanosecond).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3790" data-wpel-link="internal">Marcel</a>.</p>
<p>If you mean <a href="https://github.com/gh123man" rel="nofollow ugc external noopener" data-wpel-link="external" target="_blank">Brian Floersch</a>&#8216;s <a href="https://github.com/gh123man/Async-Channels" rel="nofollow ugc external noopener" data-wpel-link="external" target="_blank">Async-Channels</a> package, check out <a href="https://forums.swift.org/t/async-channels-for-swift-concurrency/70752" rel="nofollow ugc external noopener" data-wpel-link="external" target="_blank">the discussion about and optimisation of it</a>.</p>
<p>In short, the problems there are largely similar to the ones here with the clocks: Generics-using code not being specialised and inlined correctly.  I was able to show &#8211; <a href="https://forums.swift.org/t/async-channels-for-swift-concurrency/70752/18" rel="nofollow ugc external noopener" data-wpel-link="external" target="_blank">details in the aforementioned Swift Forums thread</a> &#8211; that if the compiler were to properly specialise Brian&#8217;s channels code then the performance actually is competitive with Go.  Unfortunately no one has been able to figure out how to actually make it do that (short of copy-pasting the code into every module that uses it). 😕</p>
<p>Swift has the unusual ability, amongst languages with Generics, of ABI compatible implementations where the types used in the generics aren&#8217;t known at compile time (and &#8220;generics&#8221; here encompasses protocols, too).  That&#8217;s super powerful &#8211; it&#8217;s what lets you use generics freely in dynamic libraries (from a functional sense, at least) and lets you use generics without forcing you to expose all your source code.  It&#8217;s worth noting that those are pretty cool benefits.</p>
<p>But, alas, there is a potential downside, which is unexpected performance problems (and perhaps more critically, highly variable performance depending on subtle contextual factors like whether you&#8217;re crossing a module boundary, and how the compiler is feeling right at that nanosecond).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marcel		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3790</link>

		<dc:creator><![CDATA[Marcel]]></dc:creator>
		<pubDate>Tue, 07 May 2024 15:05:20 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3790</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3788&quot;&gt;Wade Tregaskis&lt;/a&gt;.

Well, the interesting thing is that I got exactly the same numbers for actual ObjC NSDate that you got for the Date that you only thought was ObjC.  And our mach_absolute_time() numbers match exactly.  So the overhead of NSDate vs. Swift Date appears to be exactly zero.

And yes, there&#039;s caching, but no, it definitely is not a PIC (Polymorphic Inline Cache) and last I checked they did primarily some sort class-based caches, so performance is pretty consistent.

In general, Swift performance benefits tend to be theoretical, whereas in reality there tend to be massive performance issues, just like the one you show here.  JSON coding is very similar, with the super, compiler-optimized SwiftCoding performing worse than a ludicrously badly coded Objective-C variant based on Key Value Coding.  And I just saw a post where Swift&#039;s async channels are apparently consistently more than an order of magnitude slower than Go channels.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3788" data-wpel-link="internal">Wade Tregaskis</a>.</p>
<p>Well, the interesting thing is that I got exactly the same numbers for actual ObjC NSDate that you got for the Date that you only thought was ObjC.  And our mach_absolute_time() numbers match exactly.  So the overhead of NSDate vs. Swift Date appears to be exactly zero.</p>
<p>And yes, there&#8217;s caching, but no, it definitely is not a PIC (Polymorphic Inline Cache) and last I checked they did primarily some sort class-based caches, so performance is pretty consistent.</p>
<p>In general, Swift performance benefits tend to be theoretical, whereas in reality there tend to be massive performance issues, just like the one you show here.  JSON coding is very similar, with the super, compiler-optimized SwiftCoding performing worse than a ludicrously badly coded Objective-C variant based on Key Value Coding.  And I just saw a post where Swift&#8217;s async channels are apparently consistently more than an order of magnitude slower than Go channels.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wade Tregaskis		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3788</link>

		<dc:creator><![CDATA[Wade Tregaskis]]></dc:creator>
		<pubDate>Mon, 06 May 2024 20:49:03 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3788</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3787&quot;&gt;Marcel&lt;/a&gt;.

&lt;code&gt;objc_msgSend&lt;/code&gt; uses a cache, so what you&#039;re seeing in a tight loop is best-case behaviour where it&#039;s always hitting the cache (and IIRC the cache specially prioritises repeated calls to the same method, so it&#039;s maybe not even a hash table lookup, just a direct comparison with the last called method).

But I think your point is valid more broadly - &lt;code&gt;objc_msgSend&lt;/code&gt; is on average faster than most people are led to believe (if they&#039;re familiar with Objective-C).  And when it&#039;s not fast enough, IMP caching is easy to do.  But, I think a lot of Swift&#039;s benefits aren&#039;t actually message calls vs function calls, but &lt;em&gt;inlining&lt;/em&gt;.  That&#039;s where you can see some truly astounding performance optimisations (if the compiler plays along).

It bears repeating that I &lt;em&gt;thought&lt;/em&gt; I was benchmarking some Objective-C with the &lt;code&gt;Date&lt;/code&gt; case, until I realised &lt;code&gt;Date&lt;/code&gt; is not the same as &lt;code&gt;NSData&lt;/code&gt; in Swift (and hasn&#039;t been for ages - mea culpa).  So there&#039;s not actually any Objective-C coverage in these benchmarks (which is fine - that wasn&#039;t my objective anyway - though if there were a reasonable way to add genuine Objective-C to the benchmark package I would do that).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3787" data-wpel-link="internal">Marcel</a>.</p>
<p><code>objc_msgSend</code> uses a cache, so what you&#8217;re seeing in a tight loop is best-case behaviour where it&#8217;s always hitting the cache (and IIRC the cache specially prioritises repeated calls to the same method, so it&#8217;s maybe not even a hash table lookup, just a direct comparison with the last called method).</p>
<p>But I think your point is valid more broadly &#8211; <code>objc_msgSend</code> is on average faster than most people are led to believe (if they&#8217;re familiar with Objective-C).  And when it&#8217;s not fast enough, IMP caching is easy to do.  But, I think a lot of Swift&#8217;s benefits aren&#8217;t actually message calls vs function calls, but <em>inlining</em>.  That&#8217;s where you can see some truly astounding performance optimisations (if the compiler plays along).</p>
<p>It bears repeating that I <em>thought</em> I was benchmarking some Objective-C with the <code>Date</code> case, until I realised <code>Date</code> is not the same as <code>NSData</code> in Swift (and hasn&#8217;t been for ages &#8211; mea culpa).  So there&#8217;s not actually any Objective-C coverage in these benchmarks (which is fine &#8211; that wasn&#8217;t my objective anyway &#8211; though if there were a reasonable way to add genuine Objective-C to the benchmark package I would do that).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marcel		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3787</link>

		<dc:creator><![CDATA[Marcel]]></dc:creator>
		<pubDate>Mon, 06 May 2024 17:41:22 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3787</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3786&quot;&gt;Marcel&lt;/a&gt;.

On second thought, while there are layers being called, the bulk seems to be in mach_absolute_time(), with very little being dissipated in the layers.  Odd.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3786" data-wpel-link="internal">Marcel</a>.</p>
<p>On second thought, while there are layers being called, the bulk seems to be in mach_absolute_time(), with very little being dissipated in the layers.  Odd.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marcel		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3786</link>

		<dc:creator><![CDATA[Marcel]]></dc:creator>
		<pubDate>Mon, 06 May 2024 17:39:23 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3786</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3777&quot;&gt;Wade Tregaskis&lt;/a&gt;.

I just tried on my M1, and get the same 6ms for mach_absolute_time() you got on the M2 and also get 19ms  for Objective-C. +[NSDate timeIntervalSinceReferenceData] 

A message-send should be around 50% slower than a function call, the overhead is just the layers of stuff it&#039;s calling.

        + 1276 +[NSDate timeIntervalSinceReferenceDate]  (in CoreFoundation) + 48  [0x194999888]
        + ! 1235 clock_gettime  (in libsystem_c.dylib) + 148  [0x19475b300]
        + ! : 1198 gettimeofday  (in libsystem_c.dylib) + 56  [0x194753c9c]
        + ! : &#124; 1147 __commpage_gettimeofday_internal  (in libsystem_kernel.dylib) + 44  [0x1948780d8]
        + ! : &#124; + 1147 mach_absolute_time  (in libsystem_kernel.dylib) + 108,112,...  [0x1948766c0,0x1948766c4,...]
        + ! : &#124; 31 __commpage_gettimeofday_internal  (in libsystem_kernel.dylib) + 80,72,...  [0x1948780fc,0x1948780f4,...]
        + ! : &#124; 16 __commpage_gettimeofday  (in libsystem_kernel.dylib) + 0  [0x1948780a4]
        + ! : &#124; 4 DYLD-STUB$$__commpage_gettimeofday  (in libsystem_c.dylib) + 12  [0x1947c42dc]
        + ! : 35 gettimeofday  (in libsystem_c.dylib) + 56,0,...  [0x194753c9c,0x194753c64,...]]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3777" data-wpel-link="internal">Wade Tregaskis</a>.</p>
<p>I just tried on my M1, and get the same 6ms for mach_absolute_time() you got on the M2 and also get 19ms  for Objective-C. +[NSDate timeIntervalSinceReferenceData] </p>
<p>A message-send should be around 50% slower than a function call, the overhead is just the layers of stuff it&#8217;s calling.</p>
<p>        + 1276 +[NSDate timeIntervalSinceReferenceDate]  (in CoreFoundation) + 48  [0x194999888]<br />
        + ! 1235 clock_gettime  (in libsystem_c.dylib) + 148  [0x19475b300]<br />
        + ! : 1198 gettimeofday  (in libsystem_c.dylib) + 56  [0x194753c9c]<br />
        + ! : | 1147 __commpage_gettimeofday_internal  (in libsystem_kernel.dylib) + 44  [0x1948780d8]<br />
        + ! : | + 1147 mach_absolute_time  (in libsystem_kernel.dylib) + 108,112,&#8230;  [0x1948766c0,0x1948766c4,&#8230;]<br />
        + ! : | 31 __commpage_gettimeofday_internal  (in libsystem_kernel.dylib) + 80,72,&#8230;  [0x1948780fc,0x1948780f4,&#8230;]<br />
        + ! : | 16 __commpage_gettimeofday  (in libsystem_kernel.dylib) + 0  [0x1948780a4]<br />
        + ! : | 4 DYLD-STUB$$__commpage_gettimeofday  (in libsystem_c.dylib) + 12  [0x1947c42dc]<br />
        + ! : 35 gettimeofday  (in libsystem_c.dylib) + 56,0,&#8230;  [0x194753c9c,0x194753c64,&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wade Tregaskis		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3785</link>

		<dc:creator><![CDATA[Wade Tregaskis]]></dc:creator>
		<pubDate>Mon, 06 May 2024 16:28:07 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3785</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3784&quot;&gt;Wade Tregaskis&lt;/a&gt;.

And just to elaborate, I chose to express the benchmark results this way (and am going to leave them this way) because it&#039;s technically the more accurate statement.  There&#039;s slightly more to the benchmarks than just the call to get the time value - there&#039;s also a delta calculation and a comparison of the result, with a conditional branch.  So technically it&#039;s inaccurate to say an individual call costs e.g. 19 to 30 nanoseconds - it&#039;s potentially less, once you remove those other operations.

But, it&#039;s also not necessarily less, because CPUs have very complicated optimisations like being superscalar and other forms of parallelism.  So it&#039;s going to vary a bit depending on how it&#039;s actually used, anyway.  Numbers like &quot;19 to 30 nanoseconds&quot; need to be taken with an implied fuzziness, to account for this.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3784" data-wpel-link="internal">Wade Tregaskis</a>.</p>
<p>And just to elaborate, I chose to express the benchmark results this way (and am going to leave them this way) because it&#8217;s technically the more accurate statement.  There&#8217;s slightly more to the benchmarks than just the call to get the time value &#8211; there&#8217;s also a delta calculation and a comparison of the result, with a conditional branch.  So technically it&#8217;s inaccurate to say an individual call costs e.g. 19 to 30 nanoseconds &#8211; it&#8217;s potentially less, once you remove those other operations.</p>
<p>But, it&#8217;s also not necessarily less, because CPUs have very complicated optimisations like being superscalar and other forms of parallelism.  So it&#8217;s going to vary a bit depending on how it&#8217;s actually used, anyway.  Numbers like &#8220;19 to 30 nanoseconds&#8221; need to be taken with an implied fuzziness, to account for this.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wade Tregaskis		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3784</link>

		<dc:creator><![CDATA[Wade Tregaskis]]></dc:creator>
		<pubDate>Mon, 06 May 2024 16:19:43 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3784</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3783&quot;&gt;I have a question&lt;/a&gt;.

Sorry for the confusion - the table is showing the time for a million iterations.  So divide by a million to get the time for an individual operation (i.e. replace milliseconds with nanoseconds).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3783" data-wpel-link="internal">I have a question</a>.</p>
<p>Sorry for the confusion &#8211; the table is showing the time for a million iterations.  So divide by a million to get the time for an individual operation (i.e. replace milliseconds with nanoseconds).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: I have a question		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3783</link>

		<dc:creator><![CDATA[I have a question]]></dc:creator>
		<pubDate>Mon, 06 May 2024 15:47:00 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3783</guid>

					<description><![CDATA[You said &quot;we’re talking a mere 19 to 30 nanoseconds&quot; but in the chart it says 19 and 30 milliseconds.  Are you talking about something different or should one of the units be the other?]]></description>
			<content:encoded><![CDATA[<p>You said &#8220;we’re talking a mere 19 to 30 nanoseconds&#8221; but in the chart it says 19 and 30 milliseconds.  Are you talking about something different or should one of the units be the other?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wade Tregaskis		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3782</link>

		<dc:creator><![CDATA[Wade Tregaskis]]></dc:creator>
		<pubDate>Mon, 06 May 2024 14:48:37 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3782</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3780&quot;&gt;Nitpicker&lt;/a&gt;.

&lt;code&gt;ContinuousClock&lt;/code&gt; / &lt;code&gt;SuspendingClock&lt;/code&gt; are 13x slower (M2) and 14x slower (iMac Pro) than the next best option - and 41x slower (M2) and 28x slower (iMac Pro) than the fastest option.  So, very clearly and literally an order of magnitude slower.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3780" data-wpel-link="internal">Nitpicker</a>.</p>
<p><code>ContinuousClock</code> / <code>SuspendingClock</code> are 13x slower (M2) and 14x slower (iMac Pro) than the next best option &#8211; and 41x slower (M2) and 28x slower (iMac Pro) than the fastest option.  So, very clearly and literally an order of magnitude slower.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nitpicker		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3780</link>

		<dc:creator><![CDATA[Nitpicker]]></dc:creator>
		<pubDate>Mon, 06 May 2024 11:37:50 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3780</guid>

					<description><![CDATA[I don&#039;t think an order in magnitude is the qualification term here, I would say that a speed improvement between 1.5 and 3x is definitely non-trivial, but also definitely not &quot;well over an order of magnitude&quot;. Although it can be context-dependent, one order of magnitude is usually understood as a 10x difference.
See https://en.wikipedia.org/wiki/Order_of_magnitude]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t think an order in magnitude is the qualification term here, I would say that a speed improvement between 1.5 and 3x is definitely non-trivial, but also definitely not &#8220;well over an order of magnitude&#8221;. Although it can be context-dependent, one order of magnitude is usually understood as a 10x difference.<br />
See <a href="https://en.wikipedia.org/wiki/Order_of_magnitude" rel="nofollow ugc external noopener" data-wpel-link="external" target="_blank">https://en.wikipedia.org/wiki/Order_of_magnitude</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wade Tregaskis		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3777</link>

		<dc:creator><![CDATA[Wade Tregaskis]]></dc:creator>
		<pubDate>Sun, 05 May 2024 19:27:13 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3777</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3775&quot;&gt;Marcel&lt;/a&gt;.

True, although with the performance seen here a message send would seems suspiciously fast, if it were happening.

And indeed, now that I look at the disassembly, there are no message sends - it&#039;s basically a direct function call.  I&#039;ll update the post with some details.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3775" data-wpel-link="internal">Marcel</a>.</p>
<p>True, although with the performance seen here a message send would seems suspiciously fast, if it were happening.</p>
<p>And indeed, now that I look at the disassembly, there are no message sends &#8211; it&#8217;s basically a direct function call.  I&#8217;ll update the post with some details.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marcel		</title>
		<link>https://wadetregaskis.com/swifts-native-clocks-are-very-inefficient/#comment-3775</link>

		<dc:creator><![CDATA[Marcel]]></dc:creator>
		<pubDate>Sun, 05 May 2024 15:04:01 +0000</pubDate>
		<guid isPermaLink="false">https://wadetregaskis.com/?p=7990#comment-3775</guid>

					<description><![CDATA[Developers tend to dramatically overestimate the performance impact of message sending.  Particularly Swift tends to do things that are around an order of magnitude slower.]]></description>
			<content:encoded><![CDATA[<p>Developers tend to dramatically overestimate the performance impact of message sending.  Particularly Swift tends to do things that are around an order of magnitude slower.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
