Closed cojoj closed 9 years ago
So what compiler warning are you seeing? Or what do you mean thatt he compiler isn't happy right now?
No warnings, everything's fine... By making compiler happy
I mean providing source code that can be optimized by it. If we mark things as final
compiler will know that there will be no more puzzles with this thing 😉 Apple has stated this sometime, somewhere but I really can't find this right now... 😕
Yeah, I went to a session at WWDC where they explained that they don't have to use dynamic dispatch for final
methods, instead they can just use direct memory jump.
To be honest, at the orders of magnitude we're talking about here, I don't think it makes sense for us to jump through hoops like this. For internal
and private
methods, if we turn of something called full module optimizations
or something like that, the compiler will be able to automatically add final
to most methods. We should probably find the exact WWDC session where they describe this.
My two cents: let's not add final
manually anywhere yet, let's look at how we can help it do this automatically. This could turn into a primal example of premature optimization :wink: But thanks for bringing it up, @cojoj, we should always think about the best possible performance!
Ok I found it. It's called Whole Module Optimization
and the video is here: https://developer.apple.com/videos/wwdc/2015/?id=409
Let me know if you have anything else here, otherwise I'll close it.
No, you can close this issue - I think we're set 😉
I know I've been fighting like a lot for changing
class
es intostruct
s but @czechboy0 persuaded me that there is sense in makingXcodeServerEntity
asclass
. My main argument was:So today, I've came with solution how to marry
class
with my happy compiler thing - let's mark some methods, properties, classes asfinal
as they probably won't be inherited more times. Let me know if that make sense to you.