On Thu, May 22, 2025 at 6:53 PM John Thacker <
johnthacker@xxxxxxxxx> wrote:
This is done for several reasons. It is done to consume less memory, not having to store all the strings and other information. It is done for performance - when not displaying certain strings, they don't have to be calculated, which saves on expensive string operations. When filtering on only certain fields, fields that don't matter (and their parents, etc.) don't have to be computed. This is tremendously faster. Then too, it is frequently useful to display information about future packets if available (e.g., linking to and/or showing information from a response packet). This is accomplished in the GUI by initially doing 2-passes (and can be done in tshark with an option, though not in a live capture) so that packets have information about their responses. Attempting to add the information into the protocol tree from another packet would be difficult to impossible.
Thanks for your response. I find it also somewhat inefficient to re-parse packets when I do not need to. I understand (now) better the reasons why it's done, but both my (now) spaghetti code and the efficiency (and perhaps bugs) could be somehow avoided, I reckon, if I know better if it's the first or nTh pass.