Ethereal-dev: [Ethereal-dev] Performance - efficient coding of dissectors

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

From: Yaniv Kaul <ykaul@xxxxxxxxxxxx>
Date: Sun, 12 Sep 2004 15:38:51 +0300
Looking at some dissectors, they are not always written too well, performance-wise.

- definitions of variables inside loops
- dynamic memory allocation of strings, then strcpy'ing them (instead of perhaps declaring them in a static const array) - proto_tree_add_text(), where it'd make more sense to use proto_tree_add_item() - which I suspect in many cases would be more efficient.
etc.

I wonder how much of performance improvement we can gain by re-writing / optimzing / fixing dissectors.

Obeying to the 80/20 rule, I assume that 80% of the dissection is done in 20% of the dissectors (packet-tcp.c, packet-udp.c, ...), and those are mostly well written, but still.