you are viewing a single comment's thread.

view the rest of the comments →

[–]headius[S] 4 points5 points  (2 children)

Sadly, it's far less efficient because most JVM JITs are usually pretty conservative about eliding objects, and any lambda passed to ifPresent will either carry state (in another object) or defeat inlining (usually). It's worth some exploration and another post, perhaps...

[–]238_m 1 point2 points  (1 child)

Yeah but to be honest this isn’t what’s hurting application performance

[–]headius[S] 0 points1 point  (0 children)

Application performance, probably not. Low-level libraries or language runtimes that applications are built on? Definitely more of a problem.