Ethereal-dev: Re: [Ethereal-dev] Re: Improving filter speed

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 05 May 2005 03:15:46 -0700
ronnie sahlberg wrote:
That was from the packet-... .c patches   resetting tree to NULL to early.

Works now.

I assume that, to achieve the maximum speedup, every dissector would need to have the

	if (!proto_field_is_referenced(parent_tree, proto_xxx)) {
		tree = NULL;
		subtree = NULL;
	}

code?

If so, perhaps there can be some sort of standard {routine,macro,...} to use at the beginning of a dissector to create the top-level item and do the check. (Also, perhaps the routine should be renamed, to take into account the fact that it returns TRUE if either

	1) a field for that protocol is used in the filter expression

or

	2) the tree is visible.)