@Test public void createProtocolTest() throws ProtocolParamValidationException, JAXBException, IOException { ProtocolFactory factory = new ProtocolFactory(); ConstructedMessage message = factory.getConstructedMessage(0x1001); ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); int max = 1000000; ConstructedMessage protocol2 ; long start = System.nanoTime(); for (int i = 0; i < max; i++) { protocol2 = factory.getConstructedMessage(0x1001); } long end = System.nanoTime(); System.out.println((end - start) / 1000000); }
public ConstructedMessage getConstructedMessage(int messageId) { return keyValue.get("M-" + messageId); }
ProtocolFactory { public ConstructedMessage getConstructedMessage(int messageId) { return keyValue.get("M-" + messageId); } }
ProtocolFactory { public ConstructedMessage getConstructedMessage(int messageId) { return keyValue.get("M-" + messageId); } ProtocolFactory(); }
ProtocolFactory { public ConstructedMessage getConstructedMessage(int messageId) { return keyValue.get("M-" + messageId); } ProtocolFactory(); ConstructedMessage getConstructedMessage(int messageId); int getMessageId(ChannelBuffer buffer); }
ProtocolFactory { public ConstructedMessage getConstructedMessage(int messageId) { return keyValue.get("M-" + messageId); } ProtocolFactory(); ConstructedMessage getConstructedMessage(int messageId); int getMessageId(ChannelBuffer buffer);  }