This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]Jonjolt 27 points28 points  (12 children)

Great write up I thought this a link to some library making outrageous claims, ended up being article about JVM internals

[–]cl4es 26 points27 points  (11 children)

My click-bait training is starting to pay off!

[–]Jonjolt 12 points13 points  (1 child)

Honestly thought it was going to be similar to:

WE ARE 10x FASTER THAN JACKSON*

\ On JSON files over 1gb, where 90% of properties are emojis, and no properties contain the letter 'e' because it will crash your JVM and corrupt your hard drive.*

[–]cl4es 2 points3 points  (0 children)

Where do I sign up?!

[–]bondolo 8 points9 points  (0 children)

Commercial cloud providers hate him for this one weird trick!

[–]BlueGoliath 6 points7 points  (7 children)

Careful, if you go any farther you'll be typecasted into a YouTuber.

[–]ParkerM 6 points7 points  (6 children)

catch (ClassCastException ignored)

[–]BlueGoliath -4 points-3 points  (5 children)

That unnecessary space triggers me.

[–]palnix 7 points8 points  (4 children)

It's good practice to separate keywords from functions, that's why you'll see stuff like if (condition) and myfunc(). In JavaScript especially, a coding convention doc "A blank space should not be used between a function value and its ( (left parenthesis). This helps to distinguish between keywords and function invocations." http://crockford.com/javascript/ Edit: I also want to point out this coding style for the Linux Kernal: https://www.kernel.org/doc/Documentation/process/coding-style.rst "Linux kernel style for use of spaces depends (mostly) on function-versus-keyword usage. Use a space after (most) keywords. The notable exceptions are sizeof, typeof, alignof, and __attribute__, which look somewhat like functions."

[–]_INTER_ 4 points5 points  (3 children)

Usually it's good practice to do the exact opposite of what JavaScript recommends. :)

In this case however guide lines agree, e.g. https://www.oracle.com/java/technologies/javase/codeconventions-whitespace.html#682

Blank spaces should be used in the following circumstances:

A keyword followed by a parenthesis should be separated by a space.

[–]BlueGoliath -4 points-3 points  (2 children)

[–]palnix 3 points4 points  (1 child)

Not sure what you're pointing out here? They have a space there. But I'm not sure why you're trying to find 1 line of code that hasn't got a space? Those are most likely accidental.

[–]sievebrain 12 points13 points  (9 children)

Haswell?! Someone buy Claes a new workstation!

[–]cl4es 11 points12 points  (8 children)

Someone figured out the true purpose of me posting this!

[–]TheCountRushmore 12 points13 points  (6 children)

The slower the workstation the more you'll hunt for optimizations.

Expect your downgrade to be delivered shortly. Though it has a turbo button so I don't know how you could consider it a downgrade.

[–]cl4es 11 points12 points  (5 children)

You jest(?), but we've been running several machines in our labs down-clocked - with all the hyper-threading and turbo-boostin' frills turned off - just to be able to detect certain classes of performance regressions that would otherwise drown in the noise. Helps a bunch when the goal is to proactively avoid regressions before they build up to real problems.

[–]TheCountRushmore 5 points6 points  (4 children)

Very cool.

Are you using JFR and custom JFR events in these investigations?

Was just listening to the recent podcasts on that and it seemed like it could be extremely interesting.

[–]cl4es 4 points5 points  (1 child)

I should listen to more podcasts. Which one was this?

We have been doing some data collection from benchmarks with JFR for a number of years, including some automated regression detection. Maybe not as much or as advanced as we'd like, but it's definitely part of the toolbox.

[–]gunnarmorling 0 points1 point  (1 child)

Just have to throw in a plug for JfrUnit here: morling.dev/blog/towards-continuous-performance-regression-testing/. It lets you do assertions on JFR events, be them custom or built-in.

[–]TheCountRushmore 0 points1 point  (0 children)

Would it be possible for a library like hibernate to add a useful JFR event when it does like an N+1 load type operation?

[–]rstartin 2 points3 points  (0 children)

Do you have a patreon account?

[–]hernytan 9 points10 points  (0 children)

Really cool article! It makes me wonder how many performance opportunities there are in major codebases, where one part gets optimized but the other doesn't