[vlc-devel] Support of events in Mozilla plugin - Beta

jpd at videolan.org jpd at videolan.org
Wed Sep 2 12:00:50 CEST 2009

On Wed, Sep 02, 2009 at 11:27:13AM +0200, Yannick Br?hon wrote:
> The question is: how would you imagine settig this mask on the
> javascript side?

Pass a list of event( name string)s you want to be sent. The plugin
will walk through the list at mask-setting-time and translate it into a
bitmap. This is O(N^2) unless you have a map prepared, but since setting
masks presumably occurs not very often compared to triggering events, I
don't mind even N linear searches. Event triggers cause a bitmap lookup
and a string table lookup in the master list, both by index and thus O(1).

Like I implied: separate interface and implementation details.

I think I would prefer clear/all/add/subtract/list over set/list, though.
(Excercise: Why?)

> > Worth a look then as it'd save code. If you come up with numbers please
> > share.
> OK, we just ran a few tests. Nothing complete or extremely serious, but
> still. Machine was a dual proc @ 1.66GHz, 2GB RAM. When catching all
> events (according to our "all" profile), proc was used at around 60%
> (for the browser). We didn't do much processing, just a simple test on
> the event name after catching an event. When catching only a single
> event (begin of video play), or no events, we were running at 55%. That
> is quite a difference, and would indeed justify the extra code...

What are you doing that eats 55% cpu on that box without events?

5% cpu is not free so some filtering seems to be called for, yes.

More information about the vlc-devel mailing list