Debug Gradle's parallel mode -
we trying gradle our big , complex enterprise app. using multi project build construction , excited gradle's parallel execution feature.
our codebase structured in domain layers this:
ui modules (~20) -> shared ui -> domain -> dao -> framework
dependencies uni directional , build happens bottom up.
unfortunately not seeing big boost in our build times. pretty much same getting ant before.
looking @ execution sequence of tasks in parallel mode few things doesn't right. our expectation gradle run tasks in sequence when building core layers. after assembles framework, dao, domain , shared ui, should kick else in parallel.
but execution sequence seeing this:
framework.assemble -> dao.assemble -> domain.assemble -> shared.ui.assemble -> other ui modules.assmble (in parallel) -> war -> other ui.check + shared.ui.check + dao.check (in parallel) -> domain.check -> framework.check
bottleneck @ end when running checks domain , framework in sequence , not in parallel. these 2 modules biggest modules around 12k unit tests , take around 4 mins run.
we spent lot of time looking @ dependencies using gradle tasks --all , test task these modules independent , there nil should hold off execution.
we wondering if known issue or there way enable debugging in gradle more insight how gradle determines execution order parallel mode. help appreciated.
as of gradle 1.4, parallel task execution (intentionally) constrained in few ways. in particular, set of tasks executing @ time won't contain 2 tasks belonging same project. improved on time. i'm not aware of debugging aids other logs (e.g. --debug
).
note parallel test execution separate feature. if have lot of tests in same project, test.maxparallelforks = x
x > 1 should show noticeable speedup. value x best determined experimentally. starting point number of physical cores on machine (e.g. runtime.getruntime().availableprocessors() / 2
).
gradle
No comments:
Post a Comment