[PATCH] Improve ldb unindexed search perf

Andrew Bartlett abartlet at samba.org
Tue Aug 23 10:31:13 UTC 2016


On Tue, 2016-08-23 at 08:15 +0200, Andreas Schneider wrote:
> On Tuesday, 23 August 2016 17:28:45 CEST Andrew Bartlett wrote:
> > 
> > This patch set helps us to avoid many talloc() and talloc_free()
> > calls
> > during the scan of the whole database or of a large index.
> > 
> > Please review.
> 
> I've did a quick look an this looks great. 

Thanks.  I'm really keen to see what numbers we get tomorrow.

> However for compare functions could 
> you please do:
> 
> int cmp;
> 
> cmp = ldb_attr_cmp();
> if (cmp == 0) {
>   ...
> }
> 
> in patch #2 and the same for strcmp() in patch #3.
> 
> I would prefer to have:
> 
> if (el2->name == NULL) {
>     goto failed;
> }
> 
> instead of
> 
> if (el2->name == NULL) goto failed;
> 
> 
> We use brackets for a reason ;)

Indeed we do.  I'll gladly update the style. 

It was quite odd to start modifying code from before we felt we could
use 'bool', 'true', and 'false'.

Also to follow up is dead code removal of what ends up being quite a
similar function, lost from use long ago and before we had even a
thought about the performance cost of talloc().

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list