erlang/otp — pull request #30 by IvanDubovik (2012-11-17 08:31:31+00:00)
Title: SNMP performance optimization

I have a lot of agents:
```
ets:i().
id name type size mem owner
----------------------------------------------------------------------------
...
snmpm_agent_table snmpm_agent_table set 42932 2287790 snmpm_config
```

Was:
```
fprof:analyse().
...
{[{{snmpm_server,agent_data,2}, 513,11826.813, 4.607},
{undefined, 0, 0.446, 0.000}],
{ {snmpm_config,agent_info,2}, 513,11827.259, 4.607}, %
[{{ets,match_object,2}, 513,11822.196,11524.680},
{{ets,select_trap,1}, 0, 0.446, 0.373},
{{snmpm_server,agent_data_item,2}, 1, 0.010, 0.008}]}.
...
```
Now:
```
{[{{snmpm_server,agent_data,2}, 906, 20.413, 6.341}],
{ {snmpm_server,agent_data_item,2}, 906, 20.413, 6.341}, %
[{{snmpm_config,agent_info,2}, 906, 14.072, 7.743}]}.
```