Tests are back at 1h-1h40, depending on the actual testbot. It used to be down to 45m-1h after the plugin discovery namespace issue was resolved.
There's no obvious single big thing to point at, but I have a few ideas to improve performance. Note that the numbers below overlap, e.g. both dfac() and module enable trigger kernel rebuilds.
* 3 calls to dfac() per test method, 36% in total. Do we need all these? Can we optimize the install process and skip unnecessary steps? 57% of that is menu_router_rebuild() (90% of that _menu_navigation_links_rebuild(), 70% of that saving menu links), 22% system_rebuild_module_data()
* Drupal\Core\DrupalKernel::buildContainer() is 24%, 54% is yaml parsing (86 calls, a lot of repeated calls to the same files..), 37% is ContainerBuilder::compile() with 17 calls. Can we statically cache loaded yml files? Prevent container compiles/dumps if nothing has changed?
* We have a few more required modules than we used to. module_enable() is 25% with 12 modules (11 + one of the test). entity.module, datetime is now a dependency of node. There's still the issue to prevent node being a dependency of testing. Which would remove that and datetime from a lot of tests. field_sql_storage will away I guess when we merge field storage into the entity storage controllers. We want to remove entity.module, as we can now have plugins in components in a sane way.
* 1000 (yes, that) calls to Symfony\Component\Yaml\Parser::parse(), 86 services yml files (53% of that, huh?), 772 calls from drupal_parse_info_file (double-huh but only 28% of the time.