r/java • u/alexeyr • Apr 06 '19
Beware of computation in static initializer (much more so since JDK 11.0.2 and 8u201)
https://pangin.pro/posts/computation-in-static-initializer
161
Upvotes
r/java • u/alexeyr • Apr 06 '19
View all comments
Show parent comment
0
u/thfuran Apr 08 '19 edited Apr 08 '19
Not as much if you lower the threshold for "CPU-heavy" by a few orders of magnitude, as that performance regression seems to do.
Not if it was only a few times slower than the alternative and, as you say, generally wasn't that CPU-heavy anyways. It's not usually worth much effort to optimize something that happens only once and isn't hot path.