THRIFT-752. java: Use a faster Stack implementation in TCompactProtocol
authorBryan Duxbury <bryanduxbury@apache.org>
Sat, 3 Apr 2010 22:52:03 +0000 (22:52 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Sat, 3 Apr 2010 22:52:03 +0000 (22:52 +0000)
commit88569a25d1e8380574de16be541f9e6e18bbca12
tree97be75e7fd50fdd11a0b03b407a263016e4bf258
parent75526c999ee741b8d30de4bffcb790ff52700bbe
THRIFT-752. java: Use a faster Stack implementation in TCompactProtocol

This patch adds ShortStack, an internal implementation of Stack that works directly on primitive short objects, and makes TCompactProtocol use this. A brief performance test shows that this makes serialization about 8% faster and deserialization about 15% faster, though the actual gain you see will be dependent on the nature of your structs - the more levels, the more gain.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930593 13f79535-47bb-0310-9956-ffa450edef68
lib/java/src/org/apache/thrift/ShortStack.java [new file with mode: 0644]
lib/java/src/org/apache/thrift/protocol/TCompactProtocol.java
lib/java/test/org/apache/thrift/TestShortStack.java [new file with mode: 0644]
lib/java/test/org/apache/thrift/protocol/ProtocolTestBase.java
lib/java/test/org/apache/thrift/protocol/TestTCompactProtocol.java