[PATCH wayland] server: add helper functions for wl_global

Pekka Paalanen ppaalanen at gmail.com
Mon Mar 9 23:41:36 PDT 2015


On Mon, 09 Mar 2015 11:13:20 -0700
Bill Spitzak <spitzak at gmail.com> wrote:

> On 03/09/2015 06:34 AM, Pekka Paalanen wrote:
> 
> > What performance concerns do you have?
> 
> I suspect the worry was about allocating and freeing a temporary array, 
> but your idea of the caller passing the array avoids it.
> 
> I feel like it would be better to reduce the number of arguments to only 
> a set that there is some possibility the backend may optimize to 
> something other than a linear search. My main concern is the "data" as 
> there are instances where using NULL is valid and something you would 
> search for, and it seems really unlikely a compositor will arrange the 
> globals into sets or sorted depending on their data pointer. I'm also 
> not sure if anybody would pass a specific version number without also 
> passing a specific bind function, though I don't understand enough about 
> the version control to be sure.

I think any possible performance impact is greatly exaggerated here.

This is code that runs few times at most during program init or
perhaps on GPU hotplug or other extremely heavy operations. It is not
ran repeatedly during runtime. Therefore I do not see any need to try to
invent the most efficient implementation, because speed here simply
does not matter at all.

Just go with an API that is clear, and easy to use and clean up
afterwards.


Thanks,
pq


More information about the wayland-devel mailing list