Spin-off from #615822-37: Benchmarking / profiling of D7:
This patch simply
1) moves the switch from _drupal_bootstrap() into drupal_bootstrap()
2) moves the code in larger switch cases into dedicated functions
The main purpose is to see the actual performance of every bootstrap phase. It was considered as a temporary patch, but I seriously don't see why it shouldn't be permanent. In fact, the flow of drupal_bootstrap() is much more grokable with this patch.
There is only one nitpick that is debatable: _drupal_bootstrap() had a static $cache;
variable that was used both for DRUPAL_BOOTSTRAP_PAGE_CACHE and DRUPAL_BOOTSTRAP_PAGE_HEADER to figure out whether we need to send a X-Drupal-Cache: MISS
HTTP header.
For now, I replaced that with a drupal_static(). An alternative would be to use a global variable. Yet another alternative would be to perhaps stuff that logic into drupal_page_is_cacheable().
Comment | File | Size | Author |
---|---|---|---|
#7 | bootstrap_with_everything_else.png | 266.37 KB | catch |
#6 | bootstrap_unveiled.png | 170.99 KB | catch |
#2 | drupal.bootstrap-streamline.2.patch | 11.71 KB | sun |
#1 | drupal.bootstrap-streamline.1.patch | 11.68 KB | sun |
drupal.bootstrap-streamline.patch | 10.53 KB | sun | |
Comments
Comment #1
sunAnd this one solves the $cache variable issue.
Comment #2
sunoopsie, small logic flaw ;) Now resembling 100% the same that was there before.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedtest bot would be very unhappy if you got this wrong. code looks good.
Comment #4
sunuhm, did you mean RTBC?
Comment #5
chx CreditAttribution: chx commentedYes.
Comment #6
catchComment #7
catchAnd with context of the rest of the request (user/1 hitting /user).
Comment #8
Dries CreditAttribution: Dries commentedNice clean-up, and helps us with profiling. Committed!