Has anybody measured the performance impact of using
Result
-style classes? (and
sealed
vs.
inline
for distinguishing cases).
I imagine plenty of object allocations.
b
bogdoll
12/24/2019, 9:35 PM
Hi Marc,
I haven't done any measurement this kind. But I read often that short lived objects do not lead to problems with modern GCs. So if you create an object and throw it away very few cycles later, this should NOT lead to bad performance.
m
Marc Knaup
12/24/2019, 9:51 PM
Thanks Dieter, that’s what I hope đŸ™‚
j
jimn
12/25/2019, 12:21 PM
I would say that escape analysis with Kotlin functions is less than perfect, there are a number of low-hanging fruits in the jvm that make sense to be quickly reclaimed by escape analysis but prove not to be so until you promote a function to a loop or branch statement.
jimn
12/25/2019, 12:22 PM
one of the curious things unlike java language is that all functions are created as an static class instead of class in the same scope.