In the lazy case (streams) not really - we must store the closures of lazy operations (like the
takeLinesUntil) so that we will be able to invoke them once a terminal operation (the
forEach) is performed - so such lambdas cannot be inlined.
In the eager case on the other hand - they can be inlined but then as I mentioned in the previous post - we must create an intermediate (possibly large) list to store the results for the next step
The problem is not debugging once inside the lambda but between lambdas, and in addition the call-stack is a mess
In my work we performed many benchmarks on the case - I cannot publish them but it is quite easy to perform some yourself. In addition, there are many benchmarks on java 8 streams online:
In addition you can read this blog post: https://dzone.com/articles/java-lambdas-and-low-latency
keep in mind that once you need to store the closures (as in the stream case) - they most probably will not be removed via escape analysis