[PATCH] Only walk a directory once in vfs dirsort module

Jeremy Allison jra at samba.org
Thu Feb 9 19:00:15 UTC 2017


On Thu, Feb 09, 2017 at 06:06:03PM +0100, Andreas Schneider wrote:
> Hello,
> 
> currently in the dirsort module we walk a directory twice. First to count the 
> file and allocate memory and then to fill it.
> 
> I created a patch to only walk it once. I have a customer who walks ~200k 
> files. I optimized it to need not to much memory, so I don't double the memory 
> allocation. For 200k files you need ~56MB. If the memory is out at 55 and we 
> doulbe it, we would allocate 110 MB for a few more files.
> 
> The speed up is big enough to have a few more memory alloctation but don't use 
> too much memory.
> 
> 
> Review and push appreciated.

LGTM. Pushed !



More information about the samba-technical mailing list