-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f79b92
commit 2a84100
Showing
3 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
BuildType: Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
This example is explicitly designed to support profiling studies to make `drake` faster and more efficient. The workflow has `2n` targets, each with `n` dependencies. Increasing `n` up to 1000 puts heavy strain on the internals and dramatically increases runtime and cache size. Going forward, we want to make `drake` fast for this sort of task. | ||
This workflow is designed to maximize overhead and stress-test drake. The goal is to improve drake's internals so this example runs fast. | ||
|
||
Let n be the number of targets. There are n * (n - 1) / 2 non-file dependency connections among all the targets, which is the maximum possible. For i = 2, ..., n, target i depends on targets 1 through i - 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
# There are 2n targets, each with n dependencies. | ||
# You can increase n to put heavy strain on drake's internals for profiling. | ||
# This workflow is designed to maximize overhead and stress-test drake. | ||
# The goal is to improve drake's internals so this example runs fast. | ||
# | ||
# Let n be the number of targets. | ||
# There are n * (n - 1) / 2 non-file dependency connections | ||
# among all the targets, which is the maximum possible. | ||
# For i = 2, ..., n, target i depends on targets 1 through i - 1. | ||
|
||
n <- 4 | ||
|
||
library(drake) | ||
library(magrittr) | ||
x <- drake_plan(x = sqrt(y__)) %>% | ||
evaluate_plan(rules = list(y__ = seq_len(n))) | ||
y <- gather_plan(x, target = "y") %>% | ||
expand_plan(values = seq_len(n)) | ||
plan <- rbind(x, y) | ||
plan <- drake_plan(target_1 = 1) | ||
for (i in seq_len(n - 1) + 1){ | ||
target <- paste0("target_", i) | ||
dependencies <- paste0("target_", seq_len(i - 1)) | ||
command <- paste0("max(", paste0(dependencies, collapse = ", "), ")") | ||
plan <- rbind(plan, data.frame(target = target, command = command)) | ||
} | ||
make(plan) |