Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
routing system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jun 2015 at 18:11 UTC
Updated:
24 Aug 2015 at 10:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerNote: The patch currently has https://www.drupal.org/files/issues/2480811-73.patch included.
Comment #3
dawehnerhaha, good try daniel
Comment #4
dawehner.
Comment #5
dawehnerRerolled that.
Comment #6
Crell commentedJust some minor nits. That said, I'd like to see benchmark numbers on this to make sure the added dependencies actually buy us something measurable.
If it's a cid prefix, not a complete cid, the name should reflect that.
Please inject the service. No static calls in objects.
Comment #7
dawehnerFor sure,
Comment #9
dawehnerThere we go.
Comment #11
martin107 commentedNothing special, just sweeping up some nits
1) service definition now mentions cache_tags.invalidator
2) Added standard optional notation for final parameter
3) refactored constrictor to use arguments, in the order in which they appear - just for cosmetic reasons.
(1) makes ActionUnistallTest pass.
Comment #12
martin107 commentedOpps my patch crashed in behind #9 sorry for the confusion.
Comment #14
berdirDidn't do profiling, but look a bit at the amount of routes that we're preloading.
On a standard installation, just 30. On our production site, 272 routes... Including every public view and page_manager route. You quickly have quite a few of those, obviously. Wondering if we should somehow limit that by default or try to filter our a few more things.
{router} is the table with the most time spent according to new relic for us. We're not yet on the latest version, so we don't benefit from the route caching that @catch worked on but this query is very likely more expensive. I'll try to do some profiling locally.
Comment #15
martin107 commentedjust fixing the failing test.
Comment #16
dawehnerMh, that indeed seems to be too much. I'm curious whether we should add a flag on routes 'preload': TRUE and add this to node/{node} taxonomy/{taxonomy_term}
and user/{user} and maybe each view with a page display and some more?
Comment #17
dawehner@Berdir
I agree that we preload too many routes, but does that mean we should change it as part of this issue? IMHO this issue is about getting rid of the SQL queries and replace them with caches. How many entries we have doesn't matter for that case.
I did some profiling but as expected (as I use database caching) this does not make things slower.
Comment #18
berdirAbsolutely, I was trying to say that it is very worth to cache because there's so much. And we should additionally, in a separate issue, try to improve what we are caching.
Comment #19
berdirFor the benchmark, you could simulate having my amount of routes by creating 200-300 views clones?
Comment #20
dawehnerWell yeah sure, let's do that, even technically the actual improvement is somewhere else.
Comment #21
Crell commenteddawehner and I discussed this patch at length in today's WSCCI meeting. Short version: RTBC. This is probably the limit of how far we should try to optimize the SQL-based routing system, though. Further efforts should focus on alternative backends than an SQL table for something that's not all that SQL-ish to begin with. :-)
Comment #22
dawehnerThe only thing we might should look at is whether we still want to preload that many routes by default.
Comment #23
catchI still think we should consider moving the preload to generation somewhere. The preloading is only required because we use the generator, which for many responses may not be the case - REST, ajax, smartcache with a warm cache etc.
Comment #24
dawehnerAdded a new issue for that: #2543016: Move route preloading into the UrlGenerator: don't simply preload on every HTML request
Comment #25
wim leersNit: the interface has "tags", plural, the docs and property here have it singular.
Supernit: this is the first time I see a prefix that has the colon included.
Do we have other places that should use this new
'routes'cache tag?Comment #26
dawehnerSee #2154461: Consider persistent caching and/or CacheCollector for state system for a more generic potential approach.
Comment #27
catchI'm not 100% about caching the state query individually, #2154461: Consider persistent caching and/or CacheCollector for state system seems more promising. However that could take some time to get right, and even if we do the generator optimisation to pre-load routes only when we're likely to need them, it'll still be a lot of requests.
I opened this issue but didn't write any of the code, and @alexpott just pinged to say he was leaving it to me, so I think I'm OK to commit it.
So... Committed/pushed to 8.0.x, thanks!