The function actions_synchronize has a parameter $actions_in_code that is really not needed and can be simplified. A look at all the references to actions_synchronize shows that in any case where a $actions_in_code parameter is passed (and not the default array() is used), all that is passed is actions_list(), which we could just do by default in actions_synchronize(). This simplifies actions code and should result in a small gain in performance.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 319404-actions-synchronize-D7.patch | 2.92 KB | dave reid |
| #6 | actions-synchronize-319404-6-D7.patch | 2.78 KB | dave reid |
| #1 | actions-synchronize-319404-1-D7.patch | 2.72 KB | dave reid |
Comments
Comment #1
dave reidAttached patch and did some ApacheBench testing on the admin/settings/actions page (which calls actions_synchronize) with 500 requests. Before patch:
After patch
Result is a very minor increase (no decrease!) in performance and increase in simplicity. Patch also added needed documentation to actions_synchronize for the $delete_orphans parameter.
Comment #2
Anonymous (not verified) commentedThe problem I have is that now actions_list is called twice. And calling actions_synchronize now resets the $actions cache in actions_list. I don't think we want either to happen.
Comment #3
dave reidWhen we're running actions_synchronize, we would always want to get the latest from actions_list. By running it first in actions_synchronize, any later calls to actions_list are now cached and quick since it was already run.
Comment #4
Anonymous (not verified) commentedLet's see what others think.
Comment #5
dave reidThe main reason for this patch is simplification. Any time the actual $actions_in_code parameter is used, it's just passed array_list() in the function call (i.e.
actions_synchronize(actions_list());). It's a pointless parameter that can just be simplified by putting an actions_list() inside the function and remove that parameter.Comment #6
dave reidRe-roll after DBTNG update to actions.inc
Comment #8
dave reidTesting error. Resetting status.
Comment #10
dave reidRe-rolling.
Comment #12
dave reidTesting slave #8 failure.
Comment #13
dries commentedI'm in support for this patch. It simplifies the code indeed.
Comment #14
damien tournoud commentedInteresting patch, let's get it in :)
Comment #15
dries commentedCommitted to CVS HEAD. Thanks!