[WIP][PATCH] Improve tdb add/modify/delete loop perf by almost 20%

Andrew Bartlett abartlet at samba.org
Tue Jul 26 20:18:13 UTC 2016


On Tue, 2016-07-26 at 21:29 +0200, Stefan Metzmacher wrote:
> Am 26.07.2016 um 21:23 schrieb Stefan Metzmacher:
> > Hi Andrew,
> > 
> > I guess you have a logic bug in the following:
> > 
> > > +	if (ctx->unpack_flags &
> > > LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC) {
> > > +		struct ldb_val data_talloc = {
> > > +			.data = talloc_memdup(ctx->msg,
> > > +					      data.dptr,
> > > +					      data.dsize),
> > > +			.length = data.dsize
> > > +		};
> > 
> > 
> > I changed the logic a bit to make it more clear why we do a
> > memdup()
> > on LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC.
> > 
> > See
> > https://git.samba.org/?p=metze/samba/wip.git;a=shortlog;h=refs/head
> > s/master-tmp
> > 
> > It has the version bumps for tdb, talloc, tevent and ldb ready to
> > go
> > for 4.5.0rc1.
> > 
> > Please push if you're happy with the result.
> 
> BTW: I temporary added ldb_unpack_data_only_attr_list_flags() to
> lib/ldb/ABI/ldb-1.1.26.sigs and removed it with the version bump
> to 1.1.27 in order to get a nice "ldb: version 1.1.27" commit.

OK.  There is also another logic bug in there, fixed in my git tree,
I'll look at yours and sort it all out at work this morning.

We also have another idea that is more complex, but seems to also
improve this test.  See the attached WIP patch from Douglas and myself.

This may not make it (cache management changes on the last day before a
release may not be wise), but shows what we can do with a little
thought!

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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ldb_tdb-Keep-cache-for-index-values-we-re-use-since-.patch
Type: text/x-patch
Size: 7557 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160727/b16afce2/0001-ldb_tdb-Keep-cache-for-index-values-we-re-use-since-.bin>


More information about the samba-technical mailing list