Passing this::method reference within a loop affects performance

Follow @ionutbalosin Motivation The problem I would like address affects the performance in case this::method reference is passed to another method (especially within a long running loop), hence it is important to be aware and avoid this situation. The problem This arises when a lambda or a method reference which capturesContinue reading… Passing this::method reference within a loop affects performance

Contended locks explained – a performance approach

Follow @ionutbalosin Context Improving the performance of contended Java object monitors was added in JDK 9 as part of the JEP 143. However, as JEP 143 states, it might not be an overall performance gain on every benchmark or every test, but rather it explores few areas related to contendedContinue reading… Contended locks explained – a performance approach

An even faster way than StackWalker API for asynchronously processing the stack frames

Follow @ionutbalosin Context StackWalker API has been introduced in JDK 9 as part of JEP 259. It targets a flexible mechanism to traverse and materialize the required stack frames allowing efficient lazy access to additional stack frames when required. Before this API (i.e. until JDK 9), there were a fewContinue reading… An even faster way than StackWalker API for asynchronously processing the stack frames

Getting the stack trace versus throwing an Exception. What is common and what is different

Follow @ionutbalosin Motivation At the first glance these two things (e.g. getting the stack traces and throwing an exception) might seem very unrelated, however, they are quite similar up to a certain extent in the way they behave under the hood. Current article aims to reveal such similarities and differences.Continue reading… Getting the stack trace versus throwing an Exception. What is common and what is different

Compact Strings feature might slow down predominant UTF-16 Strings applications

Follow @ionutbalosin Motivation Current article aims to reveal how Compact Strings feature added in JDK 9 with JEP 254 behaves in case of applications where the Strings are predominant UTF-16. Context As you might now, in JDK 9 the internal representation of the String class has changed from a UTF-16Continue reading… Compact Strings feature might slow down predominant UTF-16 Strings applications

Boost your technical knowledge by effectively watching presentations

Follow @ionutbalosin Motivation We are living in a world of events and conferences on diverse topics, targeted for different people with diverse technical background and skills. The amount of ideas and approaches is quite impressive, hence almost impossible for a human brain to capture or be aware of everything! Fortunately,Continue reading… Boost your technical knowledge by effectively watching presentations

Loop invariant code motion pitfall in JDK10

Follow @ionutbalosin Current article illustrates a corner case in regards to loop invariant code motion optimization in JDK10, which at first glance seems to regress in comparison to JDK9. Such optimization tries to move outside the body of a loop statements or expressions which do not depend on the loopContinue reading… Loop invariant code motion pitfall in JDK10

Parallel streams behave sequentially up to a certain extent

Follow @ionutbalosin In this post, I would like to spotlight a bit of the internal behavior of parallel streams in Java, a feature added in JDK 8. I will start from the source code and then try to explain what really happens in the context of our test example. Basically,Continue reading… Parallel streams behave sequentially up to a certain extent

Variable vs Fixed Parameters Method Call

Follow @ionutbalosin In this article I would like to reveal the differences and what happens under the hood between a variable parameters method and the same version but with fixed number of parameters, from a performance standpoint. In regards to that I wrote a small program which tests the responseContinue reading… Variable vs Fixed Parameters Method Call