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

Optimize Drupal's Container::get()

$
0
0

Problem/Motivation

\Drupal\Core\DependencyInjection\Container::get() is called repeatedly for service IDs that are already instantiated. That is as expected, but given that, it makes a measurable difference to have it return as fast as possible in that situation.

On a fresh install of the Standard profile, accessing the front page (View with no content) by anonymous, using ab, I see a 1% improvement with this patch (256ms vs. 259ms). Note: I think ab is a better measure here than xhprof, since I think xhprof adds overhead to stack calls in order to measure them, and with this patch in particular, I think that would distort the results.

Proposed resolution

See the patch at #15, but also note those problems.

Remaining tasks

Determine a solution to the aforementioned problems and fix them.


Viewing all articles
Browse latest Browse all 302876

Trending Articles



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