Skip to content

Optimize the file management of GitHub Actions Windows builds (OSOE-156) #32

@Piedone

Description

@Piedone

The Windows builds of our GitHub Actions workflows are always a lot slower than the Ubuntu ones for every operation, even checkout (at least 2-3x slower, all the way up to 40x sometimes). Let’s try to make this better by tackling file management-related Windows issues.

To be checked

See the attached spreadsheet for measurements.

  • Disabling Windows Defender by @0liver
    • This doesn't seem to have any noticeable effect, and especially not a positive one.
  • "While there is no ext4 driver for Windows there is WinBtrfs for Btrfs, another major Linux file system. Supposedly it’s better than NTFS though worse than ext4. None of the other major Linux file systems (xfs, f2fs, reiserfs, reiser4) have Windows drivers." by @DAud-IcI
  • NTFS settings:
  • "As for git performance, looking for a different command line client based on libgit2 might help. (actions/checkout@v3 just front-ends normal git) Or perhaps the GitHub CLI which uses a different re-implementation called go-git." by @DAud-IcI
    • The checkout is slower than under Ubuntu (though lately it seems to be "just" at most 50% slower, and usually not too much slower) it's still just 30s-1m out of a 16-30m build. Even if we optimize this a lot, it won't really matter. So, I don't think we should put any effort into reinventing the git wheel, which seems like quite a lot of work anyway.
  • Virtual file system with better "lot of small files" support
  • Other performance increase options?
    • Nobody seems to care much about .NET build perf on GHA.
    • We've tried NuGet and NPM caching before without benefits.
    • BuildJet seems interesting, but the thing they don't offer is Windows builds.
    • No other ideas...

Measurements.xlsx

Conclusion

Summary of findings:

  • Disabling Windows Defender doesn't help.
  • Using a pluggable virtual file system (WinBtrfs) is slower.
  • Due to not being able to reboot, we can't change NTFS settings.
  • Git performance is not a big issue.
  • Perhaps ext4 would be better as a virtual file system, but it's impossible to use on GitHub-hosted runners.

Next steps:

  • Tuning NTFS settings can work with self-hosted runners, using our own image. Mounting an ext4 virtual drive with WLS 2 too, for that additionally we need to use an Azure VM type that allows virtualization. I've written scripts for these (or the basics of these) that may be used during packing our own images.
  • BuildJet sounds promising, and I'm testing it, but it's only for Ubuntu.

However, the best option, really, is to just use Ubuntu if possible. (It is possible for all of our Orchard Core projects, but for OSOCE, specifically, we need Windows builds to verify cross-platform behavior).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions