[PATCH 2/2] comctl32/listbox: Implement LBS_NODATA

Huw Davies huw at codeweavers.com
Tue Nov 20 05:35:55 CST 2018


On Tue, Nov 20, 2018 at 12:51:34PM +0200, Gabriel Ivăncescu wrote:
> On Tue, Nov 20, 2018 at 12:48 PM Huw Davies <huw at codeweavers.com> wrote:
> >
> > It seems to me that LISTBOX_SetCount() is likely to be a performance
> > bottleneck.  Of course one would have to do profiling to check that,
> > but it seems likely.  This could easily be optimized by allocating
> > the items in one go.
> 
> Last time I did this, the patch was rejected because "it wasn't
> LBS_NODATA behavior so let's postpone it until we implement it" or
> something to that effect. Well now I'm trying to implement it
> properly...
> 
> Keep in mind that the memory usage will be massive compared to
> Windows, even if we allocate it in one go, so it's mostly a temporary
> band-aid, if anything, and it will still depend on the number of items
> count (albeit, much faster), which it shouldn't.

I was getting ahead of the conversation and referring to the
multi-selection case, where you'd need something allocated.  Sure this
would end up using more memory than your patch, but it would be a
stepping stone that should at least help with performance in that case.

As a first step, I'd do what Nikolay proposed, and handle the
single selection case with a NULL items array.  What does that
patch look like?

Huw.



More information about the wine-devel mailing list