Does anyone have any rule of thumb, how big should...
# community-support
p
Does anyone have any rule of thumb, how big should Gradle modules (subprojects) be? I often wonder this things, when creating some feature, that contain multiple classes and I want to use
internal
visibility. I know that too big of to small module both both can have negative impact on build times. I just a few classes (like 3-4) justifiable amount to create a new module?
v
Considering build performance for when to use or when not to use multiple projects is imho premature optimization that you should avoid. Split into modules semantically how it makes sense in your project. And then iff you run into performance problems due to too big or too small modules, consider changing it. 🤷‍♂️ Also size is not necessarily the only variable. If you have a compiler that cannot do incremental compilation on file-level but only all files in a module or none, then it for example also depends on how often you modify which files for such optimizations. Because if you have a module with 1000 files and 999 of them you change once in a year and 1 you change daily, then if you split those into two modules, you daily have to recompile 1 file, if you have all in one module, you daily have to recompile 1000 files, ...
🍺 1
r
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.