[ https://issues.apache.org/jira/browse/THRIFT-752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury updated THRIFT-752: --------------------------------- Attachment: thrift-752.patch This patch adds a new class, ShortStack, that implements a trivial stack backed by an array. In the accompanying unit/performance test, once the JVM has warmed up, it seems to perform at least 10x as fast as java.util.Stack. This should essentially eliminate the stack operations as a bottleneck. > Use a faster Stack implementation in TCompactProtocol > ----------------------------------------------------- > > Key: THRIFT-752 > URL: https://issues.apache.org/jira/browse/THRIFT-752 > Project: Thrift > Issue Type: Improvement > Components: Library (Java) > Affects Versions: 0.2 > Reporter: Bryan Duxbury > Assignee: Bryan Duxbury > Fix For: 0.3 > > Attachments: thrift-752.patch > > > TCompactProtocol currently uses a java.util.Stack of Shorts internally to > manage its field id deltas. In some profiling, this seems to take more > runtime than we'd like. It's probably due to the fact that we are boxing and > unboxing the primitive shorts whenever we interact with the stack. > Since we have pretty narrow needs for the stack, I think a purpose-built > version could perform much better. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.