The Backstory
The Drupal community has been on a profiling tear recently, largely driven by Mark Sonnabaum's evangelization of XHProf. We also have recently fallen in love with a number of different Symfony2 components, and the HttpRouter is now in Drupal 8. Given all the commotion I finally installed Symfony on my local this morning and wanted to share some thoughts about the future of profiling in Drupal.
The first thing I did after the install was look at the contents of the web/ folder. In addition to app.php, there was a file called app_dev.php. App.php behaves likes a normal index.php, routing requests and the like; app_dev.php has a little something extra.

Notice that persistent toolbar on the bottom of the screen? It shows number of database requests, whether or not a user is authenticated, and which controller handled the request.
Implementing With Drupal
The fact that this toolbar is shown on each page when the user is visiting app_dev.php is important. Demonstrating how a change to a query or a control structure leads to slow page loads is something which should be shown on each request. By making this data exposed it subsequently becomes actionable; developers can see in real time how changes to their code affects application performance.
On a practical level, the same type of access control could be implemented as that given to update.php. When $update_free_access = FALSE, the user must be authenticated. This change would be about as easy as adding $dev_page_free_access = FALSE to settings.php and writing a function to generate the toolbar. Index_dev.php (or whatever the page is named) would simply have the addition of that function.
Why Should I Give a Damn?
Profiling is something the Drupal community should start doing a LOT more as a whole. It helps ensure we produce software that is ready the heavy usage it experiences in the wild. This is particularly important as we start to develop an enterprise-focused piece of software. After all, maybe calling node_load() in a loop isn't such a good idea!
