Wireshark-dev: Re: [Wireshark-dev] Startup speed up - remove dissectors?!
From: Joerg Mayer <[email protected]>
Date: Thu, 22 Nov 2007 06:08:37 +0100
On Thu, Nov 22, 2007 at 10:19:10AM +0530, Gilbert Ramirez wrote:
> It would be nice to be able to split each dissector into two source
> files... one with the actual dissector code, and one with the
> registration/cross-reference logic.
> All the cross-reference logic is loaded into Wireshark at run-time.
> Only when protocols are actually seen in a file does the dissector
> code for that protocol get dynamically loaded.

That doesn't make much sense: The registration code is only stuff
executed during startup. Or do I miss something here?

The other solution mentioned (converting everything into plugins)
doesn't work very well either (getting all the references right,
lots of overhead if many plugins need to be loaded).

The best idea I can come up with is some sort of "delayed initialization":
Don't actually initialize all the hf_ values on registration, just
provide a pointer to the hf_ array. The first time someone is accessing
the hf_ array it will be initialized. This requires the addition of
the proper logic to the acessor functions to the hf_ array. One special
case that needs attention is tshark -G. Probably others exist (checking
display filter syntax?).


Joerg Mayer                                           <[email protected]>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.