[PATCH wayland] server: add helper functions for wl_global

Bryce Harrington bryce at osg.samsung.com
Tue Mar 10 14:53:19 PDT 2015


On Tue, Mar 10, 2015 at 12:01:53PM -0700, Bill Spitzak wrote:
> 
> 
> On 03/09/2015 11:41 PM, Pekka Paalanen wrote:
> >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.
> 
> Your idea of passing an array for it to fill in seems perfectly acceptable.

Yeah, and sounds like the code isn't in a critical path anyway, as I
worried it might be, so LGTM too.

Bryce


More information about the wayland-devel mailing list