TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Surprising Cost of Protocol Conformances in Swift

59 pointsby sond813over 3 years ago

4 comments

earthboundkidover 3 years ago
I feels like I must be missing something. 3ms is extremely slow. Surely it should be 3us, no? What’s it doing that is so slow?
评论 #29440087 未加载
评论 #29450623 未加载
andrekandreover 3 years ago
<p><pre><code> &gt; The concept behind zconform is to eagerly load all possible protocol conformances and store them in a map keyed by the protocol’s address in memory. </code></pre> if it works well in most scenarios, couldn&#x27;t this just be implemented directly in the swift runtime at some point?
评论 #29437672 未加载
olliejover 3 years ago
This is about the casting cost specifically, not the direct cost of using a protocol as interface, which itself has some annoying performance characteristics
syspecover 3 years ago
Swift has a real performance problem, it doesn&#x27;t seem competitive with other &quot;systems languages&quot;<p>Is the goal to make it faster later? What can be done to get closer to that goal?
评论 #29439642 未加载