buildifier: improve Windows runner performance (#1404) * buildifier: improve Windows runner performance This change aims to improve the `buildidier`'s runner performance on Windows where it can sometimes take minutes to complete. It consists in replacing the slow COM `Scripting.FileSystemObject` with a "native" PowerShell `Get-ChildItem -Recurse` for file discovery, and batch `buildifier` invocations (100 files at a time) instead of invoking once per file. This improves performance on large codebases (like from about 2 minutes to less than 3 seconds). Notes: - cross-process COM calls add latency, whereas `Get-ChildItem` is a compiled "cmdlet". - by default, `Get-ChildItem` doesn't recurse into symbolic links to directories, which is consistent with the current implementation that explicitly avoids entering `ReparsePoint`s, - batching files passed to `buildifier` reduces process creation overhead, with a limit to account for Windows command line length limitations. References: - https://stackoverflow.com/questions/73893997/comments-in-a-long-line-powershell-code-in-a-batch-script - https://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string - https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553
This repository contains developer tools for working with Google's bazel buildtool.
See instructions in each tool's directory.