Re: Message negociation
Artem Baguinski <[email protected]>
| Newsgroups | gmane.comp.multimedia.media-api |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jan 08, 2004 at 09:43:24AM +0100, Steve Lhomme wrote:
> Toby Hudon wrote:
>
> >>I was just thinkING about pointers...
> >>
> >>We said that we need messages but that treating them all the time in a
> >>switch could have an impact on performance.
> >>
> >>So what about having a filter ask for a function to the filter it wants
> >>to send the message. It only has to do this once and then call this
> >>function instead of sending a message.
> >>
> >
> >
> >Are we really so starved for cpu power that a couple hundred compares of a
> >variable to a fixed value will kill us? How slow is it really to do "does
> >X = #?" for each entry in the switch when you pass it?
>
> Not really. But that equivalent to the message-oriented system. But more
> efficient CPU wise. And would probably lead to cleaner code too (on both
> sides). During the init/connection of 2 filters they request all the
> callbacks they need once. And then they just call functions the way they
> always do it...
the vtables with NULLs for not-implemented "methods" will be even more
efficient, cause you request all callbacks at once ;)
--
gr{oe|ee}t{en|ings}
artm