Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291177

Improve efficiency of access checker matching on routes

$
0
0

Currently when the RouteBuilder is compiling routes for the routing table it iterates over all the access checkers for every route. This seems unnecessary. It would make more sense to only iterate over the access checkers that apply for that route - this would reduce the amount of iterations and additional function calls by ALOT. This overhead could make a big difference on larger sites in particular (especially if we have to register access checkers for all the things - #2011424: Allow access methods on controllers to be used in routes).

Me and @dawehner discussed this briefly; We could have access checkers declare which requirement keys they apply to. We could then build a map of requirement keys => access checker ID and then just iterate over the requirements for each route and add the checkers that way.

Here is a *very* rough initial patch - Tests will likely fail hard, I've added an appliesTo() method to all the checkers, this is then used to compile a requirement map on the checker. So I have also changed the applies method on the AccessManager to reflect this.

AttachmentSizeStatusTest resultOperations
d8.access-requirement-map.patch14.8 KBIdleFAILED: [[SimpleTest]]: [MySQL] 56,929 pass(es), 2 fail(s), and 0 exception(s).View details | Re-test

Viewing all articles
Browse latest Browse all 291177

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>