Chad -

This is an interesting observation. Do you have a sense of how much of a
difference it makes?

I think you should open a ticket for this regression. Your proposed
solutions sound viable and easy, so I can probably whip something up prett
quickly.

-Bryan

On Tue, Jan 12, 2010 at 10:54 PM, Chad Walters
<chad.walt...@microsoft.com>wrote:

> 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