Skip to content

Commit e4391aa

Browse files
committed
Parallelize package tasks
Previously, all of the download and copying required by the package task was done sequentially. Especially in the case of the OFFLINE mode downloads, this lead to sub-optimal performance. This task makes all of the package tasks parallel, leading to a more than 40% build-time savings. [#68549674]
1 parent 37ee367 commit e4391aa

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

rakelib/dependency_cache_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def initialize
3939
@cache = cache
4040

4141
configurations = component_ids.map { |component_id| configurations(configuration(component_id)) }.flatten
42-
uris(configurations).each { |uri| task PACKAGE_NAME => [cache_task(uri)] }
42+
uris(configurations).each { |uri| multitask PACKAGE_NAME => [cache_task(uri)] }
4343
end
4444
end
4545

rakelib/package_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def initialize
3434
desc 'Create packaged buildpack'
3535
task package: [PACKAGE_NAME]
3636

37-
task PACKAGE_NAME => [BUILD_DIR, STAGING_DIR] do |t|
37+
multitask PACKAGE_NAME => [BUILD_DIR, STAGING_DIR] do |t|
3838
rake_output_message "Creating #{t.name}"
3939

4040
Zip::File.open(t.name, Zip::File::CREATE) do |zipfile|

rakelib/stage_buildpack_task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class StageBuildpackTask < Rake::TaskLib
2424
include Package
2525

2626
def initialize(source_files)
27-
source_files.map { |source| task PACKAGE_NAME => [copy_task(source, target(source))] }
28-
task PACKAGE_NAME => [version_task]
27+
source_files.map { |source| multitask PACKAGE_NAME => [copy_task(source, target(source))] }
28+
multitask PACKAGE_NAME => [version_task]
2929
disable_remote_downloads_task if OFFLINE
3030
end
3131

0 commit comments

Comments
 (0)