Skip to content

Parallelize rake preflight-checks

Kev Kloss requested to merge kkloss-parallelize-rake-preflight-checks into main

What does this merge request do and why?

This MR parallelizes rake preflight-checks because it currently runs sequentially.

kev@MacBook-Pro-som-tillhor-Kev gdk % hyperfine --warmup 2 'bundle exec rake preflight-checks' 'GDK_CHECKER_PARALLEL=1 bundle exec rake preflight-checks'
Benchmark 1: bundle exec rake preflight-checks
  Time (mean ± σ):      3.942 s ±  0.038 s    [User: 2.299 s, System: 0.898 s]
  Range (min … max):    3.875 s …  4.002 s    10 runs
 
Benchmark 2: GDK_CHECKER_PARALLEL=1 bundle exec rake preflight-checks
  Time (mean ± σ):      2.566 s ±  0.042 s    [User: 2.317 s, System: 0.935 s]
  Range (min … max):    2.499 s …  2.618 s    10 runs
 
Summary
  GDK_CHECKER_PARALLEL=1 bundle exec rake preflight-checks ran
    1.54 ± 0.03 times faster than bundle exec rake preflight-checks

Note: GDK_CHECKER_PARALLEL was a flag in testing to run the old sequential logic. You can check out main and run hyperfine there.

According to telemetry, the duration of preflight-checks is:

| Metric | Duration | | ------ | -------- | | P90 | 24s | | P80 | 21s | | P50 (median) | 17s | | P30 | 13s | | Average | 20s |

preflight-checks is on the critical path, so this has a direct performance impact on gdk update.

How to set up and validate locally

  1. Run bundle exec rake preflight-checks
  2. See that it still works
  3. Optional: Check with a tool like hyperfine that it is faster

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Kev Kloss

Merge request reports

Loading