Every time hook_nodeapi is invoked, the entire list of vocabularies is retrieved from the database. It would be more efficient to store the list of vocabularies associated with a given content type in a static variable, so each subsequent nodeapi action for that content type doesn't generate another SQL query. Additionally, the results of taxonomy_get_vocabularies can also be stored--in the event that there are multiple vocabularies using taxonomynode, taxonomy_get_vocabularies will only be called once.
I have created a patch to implement these performance improvements.

Comments

bartram’s picture

deekayen’s picture

subscribe