I was playing around with upgrading some benchmarks to Thrift 0.2 and I think 
that THRIFT-623 <https://issues.apache.org/jira/browse/THRIFT-623> may have 
introduced a performance regression.

Struct deserialization now does a map lookup to go from an integer to an 
enumeration, checks for null in case the integer was not known, and then does a 
switch on the value of the enumeration.

But it appears to me that this mapping is entirely fixed at compile time. 
Furthermore the enumeration does not appear to be used for anything other than 
performing the switch (in the struct reading routine at least).

This leads me to ask:
1. Why not just switch on the integer and have a default case for unknown 
values?
2. Why have a dynamic map for a mapping that is known at compile time? Wouldn't 
it be faster to just provide the mapping via a switch (when it is needed at 
all)?

Perhaps I am missing some subtlety but I thought I'd ask...

Chad


Reply via email to