Wireshark-dev: Re: [Wireshark-dev] RRC Messages does not decode correctely
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 30 Aug 2007 14:41:14 -0700
Anders Broman wrote:

I don't know if there'll be a significant performance hit by doing something
like:
			while (j < (guint32)min_len){
				for(i=0;i<8;i++){
					offset=dissect_per_boolean(tvb,
offset, actx, tree, -1, &bit);
					buff[j]=(buff[j]<<1)|bit;
				}
				j = j+1;
			}

There might be, but most of the functionality of "dissect_per_boolean()" isn't used if the hf_index value is -1, which it is in your code.

Perhaps the loop should do the bit-extraction itself, rather than having dissect_per_boolean() do it (and it can probably even check the bit-alignment of the offset and only fetch each byte from the tvbuff once).

That would probably perform well enough.