4 ms·
> Comparing the class count of some of today’s Java projects (including dependencies) [...] You are forgetting one important use case: defining classes dynamic
by cesarb 2y ago
> Comparing the class count of some of today’s Java projects (including dependencies) [...]
You are forgetting one important use case: defining classes dynamically. You have to count not only every class (including inner classes) of every dependency, but also all classes created at runtime through direct bytecode manipulation.
- layer8 2y agoYou are right, and I actually thought of that, but I suspect it’s usually still dominated by, or at most roughly on par with, static class count. Dynamic proxy classes, for example, are cached. And one probably shouldn’t dynamically create classes based on uncontrolled external input. The other thought I had is that if AI-generated code takes off, this could explode class count. On the other hand, AI could then also be instructed to refactor to minimal class count.
- masklinn 2y agoTBF 4 million classes is a very high amount, even in a huge project. It's not like dex files' limitation to 64Ki methods which you can very easily blow past if you have a large codebase or a few huge dependencies.