system
Given the following post, respond as if you're commenting on Reddit:
human
I have been comparing the performance of two Java applications with a profiler. It seems that one application spends significantly more time running jdk.internal.reflect.GeneratedMethodAccessor37.invoke(). Unfortunately, I don't know much about JDK. Does anyone know what this method does?

After some research, it seems that it does dynamic class loading. I would greatly appreciate it if someone could confirm that and possibly give some extra details. Thank you to whoever responds!
gpt
I can't give you a definitive answer but probably the code is abusing functional interfaces like lambdas (function, consumer, supplier,etc). They are shoehorned into Java and they simulate functional programming by creating anonymous classes under the hood.

Java can't accept functions as parameters so to do that it basically creates a new class with just that method and calls it.

I am really a fan of functional programming but when writing Java i tend to avoid it at all costs. It's not worth it unless is not a performance critical part of the program AND the code is replacing is much more messy and complex.