[PATCH] Speeding up samba-tool execution

Garming Sam garming at catalyst.net.nz
Fri Jul 15 05:07:29 UTC 2016


I've written an updated patch as the original didn't take into account
some of the ways the test code used the samba_tool class, however the
dynamic nature seems to have caused some memory allocation issues
(possibly existing issues). So unfortunately, I'm still working on this.

Cheers,

Garming

On 15/07/16 14:48, Garming Sam wrote:
> Hi,
>
> For a while now, the docs.py has been one of the longest running tests
> in autobuild. After a lot of aimless poking, I've finally found one the
> major reasons that this is the case.
>
> Samba-tool as a whole, takes a very long time to start up. This isn't
> entirely the fault of python however, nor is it because of the top level
> samba module import. What I've found is that pre-load of each samba-tool
> subcommand (e.g. testparm, dbcheck, user etc.) and the imports included
> in the subcommands massively slow down the overall tool. Besides the
> subcommand you're actually trying to run, there's no reason to load any
> of the other subcommands so I've written a patch to load the subcommand
> on the fly. This seems to suggest a 10x performance improvement with
> some basic testing (and for testparm specifically, it's now within
> striking distance of the original C code).
>
> This change should make every call to samba-tool noticeably faster and
> more responsive, which is excellent.
>
> Feel free to review and push (otherwise it will probably get rolled into
> the next time I do an autobuild).
>
>
> Cheers,
>
> Garming

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-Speed-up-all-samba-tool-commands.patch
Type: text/x-diff
Size: 3418 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160715/6b243fa4/0001-samba-tool-Speed-up-all-samba-tool-commands.diff>


More information about the samba-technical mailing list