Re: How cheap/efficient is it to have lots of protocols/instances?
Chris Jones <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
Jason Duell wrote: > Thinking about the necko protocol layer, I'm realizing I've got a > choice between two general models: > > 1) Have a single Necko protocol, and one instance per content process, > over which I multiplex all the channels that are opened. > > 2) Create a "NeckoChannel" sub-protocol of the Necko protocol, and > create an instance of it per-channel. > Subprotocols are basically free. They might cause a very small increase in code size, but nothing substantial. Subprotocol actors are also pretty cheap: they consist of 2 pointers and an int, and are entered into a hash table. > How expensive, roughly speaking, is IPC traffic? Do we have data > structures in place what will keep things efficient with large N > (well, medium N) numbers of protocol instances? Yes, message dispatch is O(1). I agree with bsmedberg regarding batching. Cheers, Chris