- Issue created by @kufliievskyi
We're encountering performance challenges with this module when applied to extensive taxonomies.
The idea is to reduce the number of SQL queries that the module sends to the database when building the hierarchy terms tree.
- Create a taxonomy hierarchy with two or more levels containing thousands of terms.
- Use any profiling tool you're familiar with to get an understanding of the number of SQL queries that the term_reference_tree module produces(one of the possible solutions is to check it via the webprofiler Drupal module).
I’ve tried to minimize the number of queries we send by using the max_depth setting we already have in the widget settings.
As I see now, the module sends requests even if these “sub-level “ elements are not outputted later in the template.
So we can use the value set in the "Maximum Depth" form field widget to stop the _term_reference_tree_get_term_hierarchy recursion if we don't need to get the nested items even if they exist.
This is not a complete solution and does not fully resolve the performance issues with large datasets. However, it can be seen as a step toward improving performance.
Active
2.0
Code
It affects performance. It is often combined with the Needs profiling tag.