• pedantcoder Profile Picture

    Pierre H. 🔥🌸 @pedantcoder

    6 years ago

    About objc_direct, a thread. I should have probably anticipated that people would raise eyebrows and spent more time explaining the point in the LLVM commit, so here it is...

    steipete Profile Picture

    Peter Steinberger @steipete

    6 years ago

    About objc_direct, a thread. I should have probably anticipated that people would raise eyebrows and spent more time explaining the point in the LLVM commit, so here it is...

    10 26 116 0 14

    7 99 280 0 60
  • pedantcoder Profile Picture

    Pierre H. 🔥🌸 @pedantcoder

    6 years ago

    The Obj-C dynamic dispatch comes with many costs, this is common "knowledge". However the details of it are rarely known. Beside the obvious cost of the h-lookup, it comes with 4 other kinds of costs: - codegen size - optimization barrier - static metadate - runtime metadata

    2 0 25 0 1
  • pedantcoder Profile Picture

    Pierre H. 🔥🌸 @pedantcoder

    6 years ago

    (1) Codegen size: In addition to `self`, `_cmd` is passed to objc_msgSend to be able to lookup your IMP. A selector is loaded from a GOT-like slot, called a selref, which in arm64 generates assembly akin to: adrp x1, mySelector@PAGE ldr x1, [x1, mySelector@PAGEOFF]

    1 0 12 0 0
  • pedantcoder Profile Picture

    Pierre H. 🔥🌸 @pedantcoder

    6 years ago

    This is 8 bytes that you pay at every call site. The number of calls to objc_msgSend is large enough that these 8 useless bytes add up. For example, in CloudKit, these 2 instructions represent 10.7% of __text. This is fairly typical of Objective-C heavy code.

    2 2 24 0 2
  • pedantcoder Profile Picture

    Pierre H. 🔥🌸 @pedantcoder

    6 years ago

    (2) Optimization barrier: Swizzling is a powerful tool, but it requires huge guarantees from the compiler. People will call out "inlining" as the lost optimization, but it's way worse. Even without inlining, the optimizer cannot be allowed to know that a trivial readonly...

    2 1 11 0 1
  • theshawwn Profile Picture

    Shawn Presser @theshawwn

    6 years ago

    @pedantcoder So? Do you have benchmarks showing that those two instructions slow down programs? And by how much? Measuring program size, especially in ObjC, is usually not very productive. It's not an accurate view of the runtime costs, which is what everyone cares about.

    1 0 0 0 0
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with X™. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro x profile viewer