Guys,

great module. But because its intended to a faster and more organic solution that a multi-step form, we must pay attention to speed and some optimizations.

There are several functions that are repeatedly executed and some do expensive SQL searches. Its good to add some caching system for them.

1* function hs_nodereference_hierarchical_select_children

Inside the main "else" can be faster by adding

    static $results = array();
    if (!empty($results[$parent])) {
      return $results[$parent];
    }

before and

    $results[$parent] = $children;

after

2* function _hs_nodereference_get_field_from_path

add the following code just after the "empty($nodereference_path)" check

  static $results = array();
  if (!empty($results[$nodereference_path][$node->type])) {
    return $results[$nodereference_path][$node->type];
  }

and dont forget the $results[$nodereference_path][$node->type] = $field; just before the return.

This not a miracle, but saves loads of SQL calls.

regards,

massa