[SNMP4J] initialize too slow

Zhan Yi zhanyi at vanlink.com.cn
Fri Apr 30 03:03:47 CEST 2004


Hi, 
    Thanks for your efforts on this project.

    I just tried snmp4j, find initialization is too slow. I tried the following code:
        Date start=new Date();
        System.out.println("starting new Snmp(): "+start);
        TransportMapping transport = new DefaultUdpTransportMapping();
        Snmp snmp = new Snmp(transport);
        Date finish=new Date();
        System.out.println("finished new Snmp(): "+finish);
        System.out.println("Time used: "+(finish.getTime()-start.getTime())/1000+" seconds");
    
    The result is:
        starting new Snmp(): Thu Apr 29 17:51:59 CST 2004
        finished new Snmp(): Thu Apr 29 17:52:19 CST 2004
        Time used: 20 seconds

    20 seconds are too long for me when i was developping code. Digging into the code, I just comment out the following line: SecurityProtocols.getInstance().addDefaultProtocols() since I am not using v3 features for now. I think this may need improve.

Regards
Zhan Yi



More information about the SNMP4J mailing list