Right now I was pointed in the direction of this v...
# education
a
Right now I was pointed in the direction of this video:

https://youtu.be/wAQCs8-a6mg

and I would like to remark that this kind of inlini functions presentation is really harmfull (if someone knows the author, please tell her). Here is my comment under the video:
Using inline function everywhere does not improve performance, but on the contrary, decreases it because JVM inlining is better than manual inlining. Also, using inline everywhere significantly bloats the bytecode because it creates a copy of the code for each call. So please, PLEASE, do not recommend using inlines for optimizations. And it definitely should not be ever used in large functions. Performance optimizations like that should not ever be used without need and without profiler measurements.
In general inlines should not be used for optimizations without profiler measurements. My own measurements show that inlining large functions significantly decreases performance. So beginniers should stick to the functions in the standard library, which are already optimized by size and usage. Without additional considerations inline should be used only for reifications and non-local returns.
k
Thank you for the note, Alexander! This video is from @Florina, I’ve added her to our group.
f
Hey! Thanks for mentioning this. I do say in the video that it should only be used for small functions, like the ones in the standard library exactly because of the performance concerns
a
Sadly, this remark is always missed. The guy from which I know about the video interpreted it exactly the wrong way and decided that all functions should be inlined "for performance". There are a lot of people out there who are mesmerized by the term "performance" and do not understand that it does not make sense without careful measurement.
By the way, I am not sure it makes a lot of sense even for small functions. I probably would not recommend to use inlines in any case where there is no reification or non-local return. Another case, where inlines actually are useful for performance are the lambdas with primitive value. Because in this case they allow to avoid boxing.