I know which one shows up in the icicle graph like a bag of cinder blocks
y
Youssef Shoaib [MOD]
08/02/2021, 1:55 AM
most likely the second one since it becomes a direct call to
delegate.foo
j
jimn
08/02/2021, 1:58 AM
this is counter-intuitive to the postulate :: > ()
y
Youssef Shoaib [MOD]
08/02/2021, 4:15 AM
I'm not sure where you got the information that
::
is more performant than
()
. In fact, usually it isn't unless you're calling an inline function with
::
as a lambda argument. I think most Kotlin devs immediately recognise
::
as a sign that there isn't huge performance optimisations done to said code because (in some cases)
::
can result in a function reference which uses costly reflection.
j
jimn
08/02/2021, 4:23 AM
when we're discussing a delegate on a vtable, or when 30 years ago we would be, :: > (*a.b) and () fast forward to present day where an interface delegation is a shim and an inline is a faster shim you would still wonder about :: costing more than any declarative keyword magic.
is there a gap list of kotlin IR vs. llvm ir features? last i knew this was the first and foremost assumption of llvm optimization unless you fancy -O0