[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Strings Experiments...
clebert.suconic@jboss.com
do-not-reply at jboss.com
Fri Feb 20 15:10:11 EST 2009
I just placed a class called UTFUtil (not being used for now), and a test on timing validating the performance.
I'm getting these numbers with org.jboss.messaging.tests.timing.util.UTF8Test:
| Time WriteUTF = 3271
| Time WriteUTF = 3061
| Time WriteUTF = 3058
| Time WriteUTF = 3044
| Time WriteUTF = 3055
| Time readUTF = 4166
| Time readUTF = 4137
| Time readUTF = 4153
| Time readUTF = 4144
| Time readUTF = 4151
| time NewUTF = 3003
| time NewUTF = 2849
| time NewUTF = 2834
| time NewUTF = 2832
| time NewUTF = 2837
| spentTime readUTFNew = 3207
| spentTime readUTFNew = 3179
| spentTime readUTFNew = 3179
| spentTime readUTFNew = 3180
| spentTime readUTFNew = 3181
|
And these numbers after changing ChannelBufferWrapper to:
public ChannelBufferWrapper(final int size)
| {
| buffer = ChannelBuffers.buffer(size);
| buffer.writerIndex(buffer.capacity());
| }
|
|
| Time WriteUTF = 3338
| Time WriteUTF = 3054
| Time WriteUTF = 3077
| Time WriteUTF = 3094
| Time WriteUTF = 3076
| Time readUTF = 4181
| Time readUTF = 4158
| Time readUTF = 4236
| Time readUTF = 4270
| Time readUTF = 4276
| time NewUTF = 2961
| time NewUTF = 2988
| time NewUTF = 2974
| time NewUTF = 2959
| time NewUTF = 2977
| spentTime readUTFNew = 3093
| spentTime readUTFNew = 3126
| spentTime readUTFNew = 3144
| spentTime readUTFNew = 3121
| spentTime readUTFNew = 3134
|
|
| Time WriteUTF = 3338
| Time WriteUTF = 3054
| Time WriteUTF = 3077
| Time WriteUTF = 3094
| Time WriteUTF = 3076
| Time readUTF = 4181
| Time readUTF = 4158
| Time readUTF = 4236
| Time readUTF = 4270
| Time readUTF = 4276
| time NewUTF = 2961
| time NewUTF = 2988
| time NewUTF = 2974
| time NewUTF = 2959
| time NewUTF = 2977
| spentTime readUTFNew = 3093
| spentTime readUTFNew = 3126
| spentTime readUTFNew = 3144
| spentTime readUTFNew = 3121
| spentTime readUTFNew = 3134
|
|
If we decide to use this UTF code, it is as simple as:
public void putUTF(final String str) throws Exception
| {
| UTFUtil.saveUTF(this, str);
| }
|
|
I will let you guys (Tim) to decide if we should use it or not.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211949#4211949
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211949
More information about the jboss-dev-forums
mailing list