Re: [PATCH] kselftest: dt: Stop relying on dirname to improve performance

From: Mark Brown
Date: Fri Dec 08 2023 - 12:29:38 EST


On Fri, Dec 08, 2023 at 10:39:27AM -0300, Nícolas F. R. A. Prado wrote:
> When walking directory trees, instead of looking for specific files and
> running dirname to get the parent folder, traverse all folders and
> ignore the ones not containing the desired files. This avoids the need
> to call dirname inside the loop, which gives a big performance boost,
> approximately halving run time: Running locally on a
> mt8192-asurada-spherion, which reports 160 test cases, has gone from
> 5.5s to 2.9s, while running remotely with an nfsroot has gone from
> 13.5s to 5.5s.

It's hard to be sure exactly since the runtime is a bit variable but it
does look like this is running substantially faster on the test systems
I have that were most affected by the slowdown, looks like approximately
a quarter of the time, and all the tests that were present before seem
to still be present.

Tested-by: Mark Brown <broonie@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature