diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2011-12-28 13:02:41 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2011-12-28 13:02:41 +0000 |
commit | 6d4226a532443ab1fe33c7d486877dbb11e154de (patch) | |
tree | 98b300c1fa6885cdabdc18ad18c7587627d6dc32 /java/common/templates/method | |
parent | 2f1ced0ba4334901984de39134c0e0b9337fa5ad (diff) | |
download | qpid-python-6d4226a532443ab1fe33c7d486877dbb11e154de.tar.gz |
QPID-3714 : [Java] Performance Improvements
Persistence:
Store message in same transaction as enqueue if possible
Memory:
Remove unnecessary (un)boxing
Reduce unnecessary copying of message data
Cache short strings
Cache queues for a given routing key on an Exchange
(0-9) Use a fixed size buffer for preparing frames to write out
Other:
Reduce calls to System.currentTimeMillis
(0-10) Special case immutable RangeSets, in particular RangeSets of a single range/point
(0-10) Special case delivery properties and message properties in headers
(0-9) send commit-ok as soon as data committed to store
Cache publishing access control queries
(0-9) Optimised long and int typed values for FieldTables
(0-9) Retain FieldTable encoded form
(0-9) Cache queue and topic destinations
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1225178 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/templates/method')
-rw-r--r-- | java/common/templates/method/version/MethodBodyClass.vm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/java/common/templates/method/version/MethodBodyClass.vm b/java/common/templates/method/version/MethodBodyClass.vm index ce8a453eeb..0e444b87df 100644 --- a/java/common/templates/method/version/MethodBodyClass.vm +++ b/java/common/templates/method/version/MethodBodyClass.vm @@ -46,8 +46,9 @@ package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor(); -import java.io.DataInputStream; -import java.io.DataOutputStream; +import java.io.DataInput; +import org.apache.qpid.codec.MarkableDataInput; +import java.io.DataOutput; import java.io.IOException; import java.util.HashMap; @@ -58,7 +59,7 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version { private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory() { - public AMQMethodBody newInstance(DataInputStream in, long size) throws AMQFrameDecodingException, IOException + public AMQMethodBody newInstance(MarkableDataInput in, long size) throws AMQFrameDecodingException, IOException { return new ${javaClassName}(in); } @@ -86,7 +87,7 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version // Constructor - public ${javaClassName}(DataInputStream buffer) throws AMQFrameDecodingException, IOException + public ${javaClassName}(MarkableDataInput buffer) throws AMQFrameDecodingException, IOException { #foreach( $field in $method.ConsolidatedFields ) _$field.Name = read$field.getEncodingType()( buffer ); @@ -171,7 +172,7 @@ public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version return size; } - public void writeMethodPayload(DataOutputStream buffer) throws IOException + public void writeMethodPayload(DataOutput buffer) throws IOException { #foreach( $field in $method.ConsolidatedFields ) write$field.getEncodingType()( buffer, _$field.Name ); |