I've profiled our page and recognized that vbo in some cases is responsible for about 30% of the processing time.
The reason for this is that VBO populates the available operations every time a view is used.
In our case that are about 1400 operations, main source is rules, and processing them takes its time.
Further investigation lead me to the conclusion that the operations aren't needed in the most cases.
Thus I'd suggest to use "lazy loading" for fetching the operations (caching isn't really applicable since we've no information if the cache has to be refreshed.).
The attached patch removes the variable all_operations in the class views_bulk_operations_handler_field_operations and replaces it by calling the new method _operations() (former populate_operations()). The new method returns the operations and uses the static cache to ensure the operations are collected only once.
| Comment | File | Size | Author |
|---|---|---|---|
| vbo-operations-cache.patch | 6.14 KB | das-peter |
Comments
Comment #1
bojanz commentedI almost have the final version of this ready to commit.
Hoping to commit it tomorrow (needs more testing today, since it's a part of a bigger refactor).
Comment #2
das-peter commentedAwesome to hear that. Tell me if I can do anything.
Comment #3
bojanz commentedI have a patch up on http://drupal.org/node/1188400#comment-5358128.
Would love your thoughts on that one, at least from a glance.
Comment #4
bojanz commented#1188400: Refactor operation types went in, so this issue should be fixed.
Awaiting das-peter's confirmation.
Comment #5
bojanz commentedLet's reopen this if further changes become necessary.