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...
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...
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
@pedantcoder Hey! Great thread! I was interested in expanding this work to leverage either static analysis or user input to (a) automatically "directify" methods without an attribute & (b) "lower" classes if all the methods used on it are direct. Do you think this might be accepted upstream?
@pedantcoder Thanks for sharing! Do you envision the use of objc_direct_members in an implementation block to reduce the size overhead of private methods to be the main use of this, or do you see people annotating a lot of their public interfaces? Mostly concerned about clutter.
@pedantcoder @layoutSubviews @threadreaderapp please unroll
@pedantcoder Wait, are you a pedantic coder or a mad coder?