Drupal's issue queue currently has a running thread regarding Drupal 7's potential new database layer based around PDO (Database Layer: The Next Generation).
I have spent some time looking at this system (starting when it was just a sample "Core" in chx's private SVN repos through to the new patch linked to above) with a view to comparing this new abstraction layer with that found in Drupal 6. The point of this exercise wasn't to see if the new system was a roaring performance gain but more to check that it hadn't potentially gone the other way.
So, on to the results of the patch to date. This was tested by creating a fresh Drupal 6 install and used the devel module to populate users, taxonomy and content. A mysqldump snapshot was taken before the tests so as to provide a rollback position for furture tests.
Next, a CVS HEAD checkout was made and the patch at #17 was applied.
The front page was then profile numerous times to find some basic averages of Drupal 6 verses HEAD+patch.
The average page generation time for Drupal 6 drifted between 535ms to 590ms.
The average page generation time for HEAD+patch drifted between 525ms to 575ms.
As for the general code path review for these can be seen here:-
| Drupal 6 | HEAD+patch |
|---|---|
For more specific comparisons by module/function here's a few more screen grabs.
| Drupal 6 _db_query() | HEAD+patch ::execute() |
|---|---|
| Drupal 6 db_fetch_object() | HEAD+patch db_fetch_object() |
|---|---|
Summary
After running numerous profiling sessions the current HEAD+patch was found to be, on the whole, slightly faster than Drupal6's implementation. However, the important thing is, at the current time, it's definitely not slower. I'll continue to profile the patch as it matures through the issue.
If you would like to follow-up on this discussion, please use the issue linked to at the beginning of this post.