Problem/Motivation

I was profiling some stuff and noticed that route preloading takes up a considerable amount of memory, about 1.5MB in my project.

As a logged in user with navigation module enabled, I also saw 9 calls to preloading routes. (note: 9 calls that actually called into the cache)

2 of those are in early bootstrap from redirect.module: #3503841: RouteNormalizerRequestSubscriber causes two extra route cache lookups.

Then there is a huge list from preloading, 168 routes in my case. Lots of things from layout builder (23 in total) , entity browser, many entity routes such as edit, delete, revision view/revert/delete, autocomplete callbacks, sitemap and more.

Then several more calls from navigation module because it loads each section separately from the menu tree. I believe that this would go away once we improve caching there, as we can properly cache the full navigation section, so not focusing on that here.

Steps to reproduce

Proposed resolution

We remove detection of probably-frequently-needed routes and bulk preloading of that. The concept is outdated, with render caching and things like per-menu preloading, the performance tests prove that we only get a handful of route load queries, even in cold/cool cache scenarios and barely any on warm caches.

Instead, we cache routes one-by-one in a new fast chained bin and use load multiple to load them as opposed to separate hashed combined caches.

There is a concern that this could fill up the fast chained bin on sites that might be running already low on memory there. Some scenarios, like using jsonapi result in significantly more routes than others. A possible mitigation for this is the ability to set a fast-bin-only TTL so that infrequently used routes are added for e.g. one day but then cleared out again. The issue for that is #3586418: Set explicit ttl in the apcu backend and allow a default to be set for chained fast. A separate issue would be to improve the current status message to check the current usage and provide a more specific guidance on how much memory you actually use and how many expunges happened (apcu doesn't delete single items, if it gets full, it just restarts)

the route preloader event subscriber is removed, no BC is provided as event subscribers are excluded from BC and there are no known usages.

This also allows to simplify the caching logic, we no longer need to maintain separate lists of unseralized and serialized routes as we know that we will need the routes that are requested.

Note on performance test changes: At a glance, this may look worse as the total number of cache requests are increasing in most scenarios and we have a few extra queries. However, a things are important to consider when looking at those numbers:

a) the new routes cache bin is fast-chained, so in most cases, these are not database/redis lookups while the data cache lookups were.
b) We load significantly less data, on larger production sites, I've seen improvements of multiple MB as we no longer load hundreds of serialized routes. This is not asserted, but is something we might be able to show on the performance test graphs if they are still running and collecting data.
c) by no longer caching already serialized strings/route definitions, the cache backend can use more optimized serializers if available.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3503843

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

berdir created an issue. See original summary.

berdir’s picture

Title: RoutePreloader loads a lot of routes » RoutePreloader loads a lot of routes, optimize it
Category: Bug report » Task

When disabling RoutePreloader and all render cache bins, I get 77 calls in total to preloadRoutes() for an anonymous user on my frontpage only 6 of them actually fetch additional routes (including the two from redirect), many of them already deliberately preload their specific routes. and mostly happening within cacheable bits. LocalTask does all the node local tasks at once, a few menus, some weird bits like .

Worth noting: Our site building approach almost exclusively uses nodes with paragraphs, we basically have no other linked routes such as views or something.

In total, less than 100kb memory reported through that method by Blackfire.

With render caches (but page and dynamic page cache disabled), I'm getting exactly 2 as anon user, those from redirect. As an admin, on the user edit form with navigation module I get 800 calls to preloadRoutes(), 13 cache lookups. On the frontpage, it's 11 with render caches on, 17 with them off. 500-600kb memory usage for admin.

(I'm optimistic that a lot of these will actually go away if we can fully cache the navigation)

Is there a third option? Can we just remove the RoutePreloader, do we really need this?

berdir’s picture

Version: 11.1.x-dev » 11.x-dev
Issue summary: View changes
Issue tags: +Performance

berdir’s picture

Somehow missed #3503843: Remove automatic preloading of all "public" routes, cache routes in fast chained bin. Will keep this separate for now to do some more testing as the approach is quite different.

berdir’s picture

Doing some tests with a different implementation.

Basically, I disabled the route preloader for now completely. On a production system that's been running for a bit, I see around 110 variations of route preloader caches with the current approach. I assume that without preloading a ton of routes on every request, there will be a lot more of those variations. Right now, the cache is always for a bunch of routes, keyed by a hash of those.

I'm changing that to using getMultiple() so we don't get many overlapping variations of different sets of routes. I'm not sure what the performance difference between a multi-cache load and a single one is. It's multiple rows, multiple cache items to expand and check. On its own, possibly slower, but I plan to combine it with the second idea:

As mentioned, I'm playing with the idea of using a ChainedFast backend for either some (either hardcoded on not /admin or by still using the Preloader, but only to feed the list of "frontend" routes) or all. For the mix, it would split the routes, and load them from the fast or regular bin. At this point, getMultiple() a bunch of routes should be a lot faster than the regular query.

Right now we cache the serialized strings because we know we don't need all of them. Without the big preload, that's no longer true and we will use those routes quite reliable. So we could consider to stop doing that and benefit from improvements such as #3014514: Make igbinary the default serializer if available, it saves 50% time on unserialize and memory footprint by caching the route objects and letting the cache backend/serializer optimize it. would also

For size comparison as to how big the router table is, on our install profile:

select count(*), sum(length(route)) from router;
+----------+--------------------+
| count(*) | sum(length(route)) |
+----------+--------------------+
|      876 |            1244156 |
+----------+--------------------+

select count(*), sum(length(route)) from router where path not like '/admin%';
+----------+--------------------+
| count(*) | sum(length(route)) |
+----------+--------------------+
|      175 |             231266 |
+----------+--------------------+

MariaDB [db]> select count(*), sum(length(data)) from config;
+----------+-------------------+
| count(*) | sum(length(data)) |
+----------+-------------------+
|     1078 |           2124343 |
+----------+-------------------+

MariaDB [db]> select count(*), sum(length(data)) from cache_discovery;
+----------+-------------------+
| count(*) | sum(length(data)) |
+----------+-------------------+
|       40 |           1454662 |
+----------+-------------------+

Full router table is around 1.2MB, similar to discovery cache and around half the size of the config table. Non-admin routes is only 200kb.

Sure, router could get a lot bigger, but every view that would be added there will also add a much bigger chunk to config.

Unsure how fancy we want to get with this, happy for some opinions.

catch made their first commit to this issue’s fork.

catch’s picture

I tried to see how many routes we really have to load on most pages.

Made some small changes to @Berdir's MR to remove all caching, which is pushed to a draft MR. In retrospect those changes were useless, because I needed to debug which routes were getting loaded anyway.

Took these steps:

install standard
uninstall toolbar
install navigation

Left myself logged in as admin.

On a dynamic_page_cache hit, I get only get route lookups for the front page view route. This is for the is_front logic in preprocess + drupal settings. We could potentially cache that lookup independently in the bootstrap cache because it is done on every page. Would love to get rid of is_front altogether too but that's not easy unfortunately.

After truncating the dynamic page cache, I got <front>, <current>, the same views route, and bigpipe.no_js.

I think we could potentially handle the special and similar routes to circumvent the database/cache altogether too, not sure how yet but we never need to match against those routes, only load them.

Overall I think we could aim for zero route lookups when dynamic page cache is warm, one or two when it's cold. And then use @berdir's approach (without the serialization hack) to cache the individual routes.

berdir’s picture

I think I tested with disabled render caches, my concerns around the caching atm are how the impact is cold caches, agreed that warm caches should have very few lookups.

A variant of the caching idea above is that we could also only use the fast cache and just don't cache others. It should only happen in the backend and for admins, and it's essentially a 1:1 of a query lookup and cache lookup.

I pushed a proof of concept for that, still using the route preloader and a new method, didn't add to interface yet, route preloader is now a misleading name.

RouteProvider already implements events too. I wonder if we should just inline that cacheable routes stuff and make it an implementation detail, unsure.

catch’s picture

That seems like a good option. Prevents an explosion of stuff getting into APCu, because it's 1-1 cache items. Front end routes will only go in when they're looked up so it may not end up being all of them. Saves having to special-case the is_front handling.

berdir’s picture

Testing this a bit on our project, this removes all 5 or so preload cache lookups against the data bin without doing any queries on a dynamic page cache hit (2 from redirect, the other from toolbar).

On a dynamic page cache miss but render cache hits, I'm getting no query lookups either.

On pages with no/partial render cache, I'm getting a bunch of stuff from toolbar, not sure why that seems to be cached with different contexts like that, but different issue.

On admin/config, it results in around 26 queries against the router table, many due to the children access check stuff. But according to blackfire, that page executes around 2000 queries (1500 key value lookups), so I don't think that hurts too much. On other admin pages such as admin/content, local tasks and help and so on are getting cached and there are 2 or so non-cached router lookups.

berdir’s picture

One downside of this is that using bootstrap for this means that we it takes longer for the bootstrap cache to stabilize, every time a new route is discovered, a new bootstrap cache entry is written, last written updated and then the fast backend needs to be updated again. But I don't think it's worse than reading a new config or plugin discovery for a less frequently used plugin type or something like that.

berdir’s picture

Status: Active » Needs review

Setting to needs review. there are test fails, but I'm looking for feedback on how to handle the RoutePreloader, if we should add a new interface on RouteProvider or just inline the whole thing. Depends on whether or not we want others to add more cacheable routes I suppose.

One thing is that we currently exclude for example json api routes, but we possibly might want to reconsider and maybe store routes per format so that we can inject other routes for the same format. not sure. This is where a json api performance test would come in handy, because I expect we'd see some regressions there as the routes aren't cached anymore.

berdir changed the visibility of the branch no-caching to hidden.

catch’s picture

One thing is that we currently exclude for example json api routes

This logic is only used for URL generation, not lookup itself which always has to hit the database to path match, does that even happen for json api routes?

berdir’s picture

I didn't verify, that's why a test would be useful, but I think so? JSON:API contains lots of relationships and references to other pages, and I think they are created as routes?

berdir’s picture

Did a very basic test and I counted 10 or so router queries on a jsonapi route for a single article, they are now all uncached, on HEAD they are single data cache lookups.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new32.06 KB

Merging in the json api performance test, as expected, getting 7 or so extra uncached queries atm.

Testing my idea of storing routes per format, instead of only html. on umami, that results in this route count after enabling rest and jsonapi:

so, 140 HTML, 225 for jsonapi. And that's not a huge amount of bundles and field. jsonapi creates a 2 routes for every bundle plus 2 for every reference field/relationship. Seems like that should be possible to do using parameters, but that's a different topic. I didn't enable any resources for rest.

I'm a bit surprised that I didn't see any ajax/js formats, I guess those routes are using html, so I also assume that currently they are not preloaded as the request format then afaik doesn't use HTML. Maybe we want to unify them to HTML? So many scenarios where performance test could be interesting (views ajax, form ajax?).

Anyway, implemented that, and expected the number of queries to go down on the second cached request then. Except they didn't. The reason is that jsonapi is faking support for the request format. See \Drupal\jsonapi\Routing\EarlyFormatSetter. But with my request event priority change in this issue (to fix route caching for lookups coming early from redirect module), it doesn't yet see that. Reverting the weight change for now gives me the expected result. All the data cache lookups now shift to bootstrap lookups. Whether that's really worth I'm not quite sure.

berdir’s picture

Changing the subscriber to be after routing/dynamic page cache exposes the problem again for things that are not part of dynamic page cache.

This already happens on HEAD, but there it still hits the data cache. OpenTelemetryAuthenticatedPerformanceTest exposes this perfectly. Before the last change, I was able to move 2 cache lookups from data to bootstrap because it has the cacheaable list there (This is the isFrontPage() check in LanguageBlock, so very similar to redirect module)

I think this is doing too much at once, but I'm not quite sure yet how to cut it yet. Will try to work on an updated issue summary when I have more time, but essentially, I guess we should keep the data cache for non-optimized cases, then we should mostly be able to keep the status quo. And we can either optimize regular requests and ignore json:api for now, or optimize that. And considering that we now have a lot more blocks being rendered outside of dynamic page cache, I think it makes more sense to focus on that. A separate issue/request subscriber could still add jsonapi routes on jsonapi requests, bonus points for figuring out how to not add the regular ones.

Remaining is also BC (added a new method to an interface for now for the unit test) and naming (RoutePreloader no longer preloads routes) things to figure out.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

catch’s picture

#3506653: Add an API for comparing the (current) route name that takes into account deprecated routes is likely to rely on the route preloading even more than we already do.

Not strictly related to trying to factor it out, but something I just noticed:

On a 404, we make subrequest to the configured 404 pages, and we preload routes twice, this probably needs a quick spin-off issue with an ::isMainRequest() check. (edit: no we don't, was seeing something else).

catch’s picture

Opened #3528775: Change JSON:API routes from every bundle/field to using field/bundle as arguments for JSON:API routes. If we can do something like that issue it might change some of the numbers in #21.

catch’s picture

Opened #3549325: Try to preload routes via Fibers (with no positive results yet).

mathilde_dumond made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

catch’s picture

Opened #3586104: Move route loading into chained fast and remove RoutePreloader to see what it looks like if we get rid of it.

berdir’s picture

Title: RoutePreloader loads a lot of routes, optimize it » Remove automatic preloading of all "public" routes, cache routes in fast chained bin
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +DevDaysAthens2026
catch’s picture

Trying to summarise what the performance tests show:

We're removing the cache item with all public routes altogether, this is the memory saving.

The menu route preloading is more or less neutral, instead of a single cache get for all non-public routes per menu, it's now a single cache getMultiple for all routes per menu (that aren't already loaded), so the same number of backend lookups as before in terms of what we measure.

However, now those cache gets are against a chained fast backend instead of the persistent backend which should equate to a handful of ms saving.

We add one or two cache gets or database queries in some circumstances, these are generally either for the route of the page we're requesting, or the front page. We have issues open to try to eliminate those route checks at least as things that are done on every request by core. This leads to overall a neutral or very slight increase in cache gets since we dropped the public route preload. When they're hits, they'll also be against chained fast.

Notably what we're not adding is large number of route lookup database queries or equivalent cache gets, this is because the menu handling covers a lot of the routes on the page.

Overall this is a similar-ish change to #3496369: Multiple load path aliases without the preload cache, we've added enough relatively generic performance optimisations and caching layers in other places, that the highly specific caching layer we added before all of those were fully in place is now redundant.

The memory profiling done by @berdir should be equally valid with the changes in the MR as before or at least close enough.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Needs review
longwave’s picture

Maybe thinking way outside the box here, but #3583505: Use Symfony PhpDumper instead of a serialized array container structure seems to be going well, and Symfony supports dumping routes to compiled PHP. Can we prevent routing requests from hitting the database or cache at all, by following the same idea? I will try some experiments...

berdir’s picture

This is primarily about avoiding excessive memory usage, PHP dumper would have exactly that problem and worse, as it would need load all routes into memory on every request.

longwave’s picture

Any string data would be shared between processes because of how opcache interns strings, which I think would help to some extent at scale, but it's going to be a trade off for sure. Will try anyway - it might be worth allowing it as an opt in.

catch’s picture

I think an experimentation issue would be interesting, but as @berdir says there are a few things to worry about:

- loading the array of 1.5-4k routes into memory on every request
- string matching against 1.5-4k routes in PHP for incoming routing might be worse than the database, this was one of the main reasons the database implementation was adapted from Drupal 7 vs. chucking everything into a cache item or similar.

Issues like #3528775: Change JSON:API routes from every bundle/field to using field/bundle as arguments and also the sheer number of admin routes on any Drupal site make it not easy.

As far as I'm concerned this issue is ready but a fraction of the code is mine so not sure how eligible to RTBC I am.

I opened #3586418: Set explicit ttl in the apcu backend and allow a default to be set for chained fast as a possible way to keep APCu size down despite putting more things into chained fast, don't think that should block this though.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Needs review

Rebased.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Although I theoretically contributed code here, my spin-off issue part of which got merged back was more like an experimental review of this issue - didn't want to make the changes here in case they were a dead end. So I'm going to go ahead and RTBC - this should be a lot more efficient overall.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

Rebased with performance tests conflict.

> this should be a lot more efficient overall.

It's worth pointing out that this might not be obvious from the performance test, I explained why those numbers (seem to) increase in the updated issue summary.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Reviewed & tested by the community

Minor performance test conflict, verified the updates locally.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Left some comments on the MR.

Also looking at things shouldn't we move all the code in \Drupal\Core\Routing\RouteProvider::preLoadRoutes into \Drupal\Core\Routing\RouteProvider::getRoutesByNames and deprecate \Drupal\Core\Routing\RouteProvider::preLoadRoutes() and \Drupal\Core\Routing\PreloadableRouteProviderInterface? Plus then we could remove the pointless array_interesect_key stuff from return array_intersect_key($this->routes, array_flip($names));.

berdir’s picture

Replied there. Not sure about merging/deprecating the preload interface/method completely. But looking again, I thought the local task/menu tree services did call that method but they don't. They call getRouteByNames() and ignore the return value. So I guess why not, we can deprecate and make it call getRouteByNames().

I'm not sure we can drop the array_intersect_key() though? We still need to get all the routes we requested, and preLoadRoutes() only really deals with the possible subset of those that aren't loaded yet?

berdir’s picture

Status: Needs work » Needs review

I thought a bit more about the deprecation of \Drupal\Core\Routing\PreloadableRouteProviderInterface::preLoadRoutes() and I'd suggest we push the discussion on deprecating or making other changes to how it works to a follow-up issue. I had the idea that we could change preload to work more like \Drupal\Core\Cache\CacheTagsChecksumPreloadInterface::registerCacheTagsForPreload(), so that multiple callers can register their routes and then we load them in one go.

On the other hand, this might be overkill, since on all but the first few requests, these routes should almost exclusively hit the APCu cache. I did some quick exploration on that and didn't get any significant performance test improvements out of it (there was significant reshuffling of executed queries on cold caches, but at least one test even had a slight increase in number of queries)

Still, this is already pretty complex and deprecating that requires some changes to other components such as \Drupal\Core\Menu\MenuLinkTree::load(). I can create a follow-up issue if that's OK.

I did the property deprecations and a post update, and created a CR to explain the behavior change and also mention that sites might want to review their APCu configuration. Depending on what happens with other issues such as the views data and the ttl expiration one, this might be worth putting into the 11.4 release notes.

catch’s picture

I had the idea that we could change preload to work more like \Drupal\Core\Cache\CacheTagsChecksumPreloadInterface::registerCacheTagsForPreload(), so that multiple callers can register their routes and then we load them in one go.

Feels like this ought to theoretically work for menus so we load all the routes from all the menus instead of menu by menu. Maybe we should open a follow-up to explore that more, and if we get stuck, then repurpose for deprecating it?

longwave’s picture

Added some questions/suggestions.

alexpott’s picture

Re #47/#48 okay let's not deprecate the interface and method here and let's leave the code in preLoadRoutes() - thanks for exploring all this.

berdir’s picture

> Feels like this ought to theoretically work for menus so we load all the routes from all the menus instead of menu by menu. Maybe we should open a follow-up to explore that more, and if we get stuck, then repurpose for deprecating it?

Yes, that is the idea, I did implement that locally, but it didn't really have a big impact. I opened #3589340: Re-evaluate the concept of preloding routes.

That said, routes are fast to load, even when not cached and their size is quite finite and soon warm. in most cases, large menus only use few different routes. I think it would be more beneficial to implement the same logic for entities and aliases: #3559353: Find a way to bulk load entities and aliases in menus. Right now if you have 3 menus with 20 links to nods each, then what happens is with the fiber stuff is that you load them in 20 groups of 3. But they aren't typically of equal size.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Needs review

Rebased, StandardPerformanceTest conflicts due to the removed content types.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Needs review

Another performance test rebase.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

longwave’s picture

Bot is correct, there is a merge conflict in the performance test.

berdir’s picture

Status: Needs work » Needs review

There is always a performance test merge conflict.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

I think this is ready.

  • catch committed 12da330a on main
    task: #3503843 Remove automatic preloading of all "public" routes, cache...

catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

For the same reason I think I was eligible to RTBC in #40 I think I'm OK to commit now since it's had a review from @alexpott and new RTBC from @longwave. Let's cause some performance test conflicts for some other issues instead.

Really good to get to a point where caches that were originally added more or less out of desperation due to potentially dozens or hundreds of database queries per page can be retired (mostly this and #3496369: Multiple load path aliases without the preload cache) - because everything else has improved around them to the point they're no longer as efficient as something lighter and simpler.

Will need an 11.x backport.

berdir’s picture

Status: Patch (to be ported) » Needs review

Yay!

Cherry-picked the commit on 11.x, only conflicts where on the performance test and the removed RoutePreloaderTest.

  • catch committed d0380f86 on 11.4.x
    task: #3503843 Remove automatic preloading of all public routes, cache...

  • catch committed 01c9d718 on 11.x
    task: #3503843 Remove automatic preloading of all public routes, cache...
catch’s picture

Status: Needs review » Fixed

Committed/pushed the backport to 11.x and 11.4.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.

catch’s picture

Version: 11.x-dev » main
Status: Fixed » Needs work

There's a problem here.

::getRouteCollectionForRequest() which caches route lookup based on the path (including path aliases) is using the same cache bin. That absolutely should not go into chained fast.

So we should have kept cache_data passed in and added cache_routes.

Only a small change so not reverting for now, maybe we can fix it with a quick follow-up MR.

catch’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Reviewed & tested by the community

Good find, I previous had the second bin like that in an earlier MR, but we lost it when switching to only using a fast chained bin for route loading.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 8feb0d7 and pushed to main. Thanks!

We need a new MR for 11.x / 11.4.x because perf tests...

  • alexpott committed 8feb0d7c on main
    task: #3503843 Remove automatic preloading of all "public" routes, cache...
catch’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

11.x backport is up and the MR is green.

  • alexpott committed 036415db on 11.4.x
    task: #3503843 Remove automatic preloading of all "public" routes, cache...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed ff23e34e4c6 to 11.x and 036415dbe0c to 11.4.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.

  • alexpott committed ff23e34e on 11.x
    task: #3503843 Remove automatic preloading of all "public" routes, cache...