[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Strings Experiments...

timfox do-not-reply at jboss.com
Fri Feb 20 06:05:06 EST 2009


Your conmparison is invalid:


  | public void testPutString() throws Exception
  |    {
  |       ChannelBufferWrapper buffer = new ChannelBufferWrapper(10 * 1024);
  | 
  |       for (int c = 0; c < TIMES; c++)
  |       {
  |          long start = System.currentTimeMillis();
  | 
  |          for (int i = 0; i < numberOfIteractions; i++)
  |          {
  |             if (i == 10000)
  |             {
  |                start = System.currentTimeMillis();
  |             }
  |             buffer.rewind();
  |             buffer.putString(str + i);
  |          }
  | 
  |          long spentTime = System.currentTimeMillis() - start;
  | 
  |          System.out.println("spentTime putString = " + spentTime);
  |       }
  | 
  |    }
  | 

You are adding the integer i to the string in some of the tests. These will cause a new string and a copy. You're not doing that when you're testing with SimpleString

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211751#4211751

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211751



More information about the jboss-dev-forums mailing list