Whilst setting up a performance testing environment I noticed that we can improve the implementation in node_block_access() to not do unnecessary calls to menu_get_object(); and node_type_get_types();.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | without-patch-2.png | 177.08 KB | alexpott |
| #3 | with-patch.png | 140.46 KB | alexpott |
| #3 | 1-2-interdiff.txt | 560 bytes | alexpott |
| #3 | 1994468.node_block_access_perf.2.patch | 2.23 KB | alexpott |
| #1 | 1994468.node_block_access_perf.1.patch | 2.16 KB | alexpott |
Comments
Comment #1
alexpottHere's the patch
Comment #2
alexpottComment #3
alexpottHere's an xhprof of the function calls to node_block_access on the front page of a Drupal standard install with 2 nodes promoted...
Without the patch
With the patch
Comment #4
catchLooks great.
Comment #5
alexpottWell... I wrote the patch and catch rtbc'd so this is Dries's :D
Comment #6
dries commentedCommitted to 8.x. Thanks.
Comment #7
dries commented