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#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...