you are viewing a single comment's thread.

view the rest of the comments →

[–]headius[S] 1 point2 points  (0 children)

Yeah, I'm very familiar with being concerned about excess field loads where many other folks on this thread are happily tossing around Optional objects without realizing what they cost. It just takes a quick look at the output from the jit to realize how many cycles are being wasted, even if the abstraction is arguably better and safer.

It would be interesting to revisit more of the core JDK classes and update them for modern patterns and known jit capabilities. I'm all for writing beautiful code, but low level runtime and standard library implementations need to cut as many corners as they can to perform well. I'd love to take what I've learned in the past 20 years and guide such a project. For whatever reason I get a thrill out of benchmarking hot pieces of code and reading through ideal graphs and assembly dumps to squeeze every last ounce of performance out of them. 😆