You're better off generating more methods than classes. More classes means longer startup time, larger memory footprint, and more GC marking overhead.
Irrespective of method or class generation, keep an eye on your code cache usage; if it's exhausted, compilation will cease and performance will drop off significantly.
Your source java file with multiple classes will generate one class file per class in there, so from runtime performance aspect I don't think it matters.
sent from my phone
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
They're not free, but think about it: if you generate a class, you still need the method. So for each method you end up with an enclosing class that's carrying metadata, takes up space in the system dictionary, sits on the class resolution path, is examined for class load dependency checks, etc. It's a waste if its only reason for existence is to provide a home for one generated method.
But as I mentioned, perf after startup will likely depend on code cache.
sent from my phone