| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | Performance |
Issue Summary
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().
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal.bootstrap-streamline.patch | 10.53 KB | Idle | Passed: 14608 passes, 0 fails, 0 exceptions | View details |
Comments
#1
And this one solves the $cache variable issue.
#2
oopsie, small logic flaw ;) Now resembling 100% the same that was there before.
#3
test bot would be very unhappy if you got this wrong. code looks good.
#4
uhm, did you mean RTBC?
#5
Yes.
#6
#7
And with context of the rest of the request (user/1 hitting /user).
#8
Nice clean-up, and helps us with profiling. Committed!
#9
Automatically closed -- issue fixed for 2 weeks with no activity.