Hi, Robert Thanks for the suggestion.
Net-SNMP v5.3.0.1 does have the CONTAINER_SET_OPTIONS macro defined. However, trying to set the option to UNSORTED had no effect. (CONTAINER_SET_OPTIONS() sets the return code to -1, so the 'options' field of the container is apparently a null pointer.) grep'ing the source code, I can't find any actual mention of the 'options' field other than in the _SET_ and _CHECK_ macros. So it looks like this won't help for 5.3.0.1 If/when I update to a current version of net-snmp, I will try this technique. Until then, are there any other things to try? -- James -----Original Message----- From: NetSNMP Mailbox [mailto:[email protected]] On Behalf Of Robert Story Sent: Wednesday, November 30, 2011 12:58 PM On Fri, 25 Nov 2011 10:59:59 -0500 James wrote: JP> My MIB has a number of statically-sized tables. I have increased the JP> size of one of those tables to 10,000 rows. (It was less than 1000 rows JP> previously). JP> JP> At start-up, my code executes JP> JP> entry = SNMP_MALLOC_TYPEDEF (struct my_table); JP> row = netsnmp_tdata_create_row (); JP> ... JP> netsnmp_tdata_row_add_index (row, ASN_INTEGER, &entry->item, sizeof JP> (item)); JP> netsnmp_tdata_add_row (table_data, row); JP> JP> for each row. This takes a long time - about 30 seconds. JP> JP> Is there a way to reduce the time it takes to create this table? JP> JP> (Putting in log statements, e.g. after every 1000 rows, shows the JP> insertion to be taking order-N^2 time. Would inserting the rows JP> backwards make any difference?) What you want to do is set the table container to unsorted at startup, while you are inserting rows.. int rc; netsnmp_tdata *my_table = netsnmp_tdata_create_table(...); CONTAINER_SET_OPTIONS(my_table->container, CONTAINER_KEY_UNSORTED, rc); /* insert data here */ ... /* clear unsorted flag */ CONTAINER_SET_OPTIONS(my_table->container, 0, rc); JP> net-snmp version: v5.3.0.1. (I am considering updating to a newer JP> version. But that won't necessarily solve this issue.) Hmm.. I only keep as far back as 5.4 around. Not sure when CONTAINER_SET_OPTIONS was added, but you can give it a shot. ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
