Situation: 35 000 terms in vocabulary, 3 levels. when i go on the node add some article with taxonomy_hierarchical_select widget for this vocabulary i have 4 seconds loadding time. so

// We cache trees, so it's not CPU-intensive to call get_tree() on a term
// and its children, too.

seems do not work for me. i measured the function _hs_taxonomy_hierarchical_select_get_tree
and this where my 4 seconds

  if (!isset($children[$vid])) {
    $children[$vid] = array();

    // TODO Please convert this statement to the D7 database API syntax.
    $result = db_query('SELECT t.tid, t.*, parent FROM {taxonomy_term_data} t INNER JOIN  {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE t.vid = :vid ORDER BY weight, name', array(':vid' => $vid));
    foreach ($result as $term) {
      $children[$vid][$term->parent][] = $term->tid;
      $parents[$vid][$term->tid][] = $term->parent;
      $terms[$vid][$term->tid] = $term;
    }
  }

My question is why do we need to get a tree of the dictionary when the page loads. Why not use AJAX for child lists? For the first list (level 1) require only the upper terms. i do not need all that mega functionality of THS filters or something else, just 1 simple relative list with terms name and terms ID for value.