Run rake tasks natively in gdk update process
What does this merge request do and why?
This MR changes tasks that are written in Rake but referenced as their Make version to use the Rake version in update.rake
. That runs them in the same process, so they are faster and we don’t rely on Make there.
Snapshot
This is a snapshot of two gdk update
s:
Task | Before | After |
---|---|---|
preflight-checks | 10.327s | 7.838s |
preflight-update-checks | 2.005s | <0.01s |
Hyperfine
Here’s a direct comparison of make
vs rake
on preflight-checks
as example.
kev@MacBook-Pro-som-tillhor-Kev gdk % hyperfine --warmup 2 'bundle exec rake preflight-checks' 'make preflight-checks'
Benchmark 1: bundle exec rake preflight-checks
Time (mean ± σ): 3.936 s ± 0.036 s [User: 2.290 s, System: 0.908 s]
Range (min … max): 3.894 s … 4.005 s 10 runs
Benchmark 2: make preflight-checks
Time (mean ± σ): 9.293 s ± 0.775 s [User: 5.088 s, System: 2.235 s]
Range (min … max): 8.767 s … 10.946 s 10 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
Summary
bundle exec rake preflight-checks ran
2.36 ± 0.20 times faster than make preflight-checks
How to set up and validate locally
- Run
GDK_SELF_UPDATE=0 gdk update
- See that it works fine
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
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 theCHANGELOG.md
.