I run “trytond-admin --all” using vmprof and a quick look seems to indicate that around 40% of the time is spent on convert.py’s fetch_new_module().
This method caches all the ir.model.data information of a module when another module references at least one of its records.
For example, say that a module wants to add a menu item which has the “Products” menu item as parent. Then, fetch_new_module will ensure all ir.model.data identifiers of the “product” module are loaded.
The problem seems to be that when I run --all, if I have both “product_measurements” and “product_price_list”, fetch_new_module() willl be called twice (and loaded twice) because the information loaded on the update of “product_measurements” is not reused when “product_price_list” is updated.
Before trying to go any deeper, as I don’t have an in-depth knowledge of this process and its implications I was thinking: would it be doable to cache this information? What side effects could it have?
One possible problem I undestand that there may be is if some __register__
method updates ir.model.data table directly, but we could allow some kind of invalidation in that case.
40% seems like a huge percentage, not to try to reduce it somehow.