>As computing the NullPointerException message proposed here is a considerable overhead, this would slow down throwing NullPointerExceptions.
You could lower the overhead by not producing these messages if the exception is thrown frequently. It would be similar to the existing OmitStackTraceInFastThrow mechanism [0].
[0]: https://www.oracle.com/technetwork/java/javase/relnotes-1391...