If table interator helper is used to access sorted tables, a small change in netsnmp_table_iterator_helper_handler() can greatly improve performance.  Giving the get_first_data_point function access to the indices from the request (i.e. it is passed the netsnmp_table_request_info *) the function can begin the search starting from the index values and not from the first entry as currently required.  This can be done by setting the callback_loop_context to table_info before the call to get_first_data_point.  No change is required in function definition.  It should have no impact on existing get_first_data_functions which only set callback_loop_context.

 

            if (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED) {

                callback_loop_context = table_info;

            }

            index_search =

                (iinfo->get_first_data_point) (&callback_loop_context,

                                               &callback_data_context,

                                               index_search, iinfo);

 

 

Comments?

 

Mike Thatcher

 

Reply via email to