I noticed that using buildExecutionService in Gradle builds increases the build time by about one minute. Is this normal, and are there any ways to optimize it?

I have developed a Gradle plugin with the aim of obtaining performance metrics during the Gradle build process. I used the following method to register the service: registry.onTaskCompletion(buildExecutionService). However, when I compared build times before and after applying the plugin, I noticed that the build duration increased by about one minute. Strangely, the Gradle profile report did not reveal any obvious bottlenecks or time increases corresponding to this slowdown.

Is it possible that the time increase is caused by buildExecutionService? Are there any ways to optimize and reduce this additional build time?

It is hard to guess what buildExecutionService is or does.
If it needs time to do whatever it does, then that might cause it. :man_shrugging:
You could e.g. use the gradle-profiler to check where your time is spent and what might cause it.