Problem/Motivation

Based on https://drupal.slack.com/archives/C072BF486FN/p1787824351324739 I was wondering why the last step of the Drupal CMS installer takes so long.

First we uninstall the profile, which force-rebuilds the router.

Then immediately afterwards, we rebuild the router again. Only need to do it once.

Steps to reproduce

Proposed resolution

Only explicitly rebuild the router if the profile is not going to be uninstalled.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#3 Screenshot from 2026-08-27 12-50-35.png339.33 KBcatch

Issue fork drupal-3619447

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
StatusFileSize
new339.33 KB

Did some testing.

First of all I profiled standard install against main with no changes, and confirmed there's only one router rebuild.

Then I added keep_profile=false to standard.info.yml and installed again - this time I got two router rebuilds, each taking approx 450ms eac

Then I switched to the MR branch, did the same thing a third time, and back down to one router rebuild again.

catch’s picture

Issue summary: View changes
gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks very straightforward. I sent the two JS test fails for rerun but they looked unrelated. Only one of them was a random fail I usually see, but the other one looked alike :D I expect they will come back green. The change is simple and very nice for usability.

  • godotislate committed 40ed96f6 on 11.x
    task: #3619447 Avoid rebuilding the router twice when uninstalling a...

  • godotislate committed 8cb43d97 on main
    task: #3619447 Avoid rebuilding the router twice when uninstalling a...
godotislate’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 8cb43d9 to main and 40ed96f to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

gábor hojtsy’s picture

FYI In my testing this last step is 8.3s on average on my current virtual machine in Drupal CMS. With this change it saves 0.86s of that, so about 10% saved :) That's pretty good. While waiting for Drupal 11.5, we can save 0.7s of that already by reordering the rebuilds in CMS, so opened https://git.drupalcode.org/project/drupal_cms/-/work_items/3591442 for that. That means only 0.160s of this will be left for 11.5 when Drupal CMS can require Drupal 11.5 but this 0.7s improvement is also inspired by the core fix :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.