-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
9 changed files
with
231 additions
and
39 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
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
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,3 @@ | ||
#' @param consistent (`logical(1)`)\cr | ||
#' Whether the task and result structure are consistent. | ||
#' When the tasks are consistent, fetching tasks is faster. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
/.quarto/ |
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,114 @@ | ||
--- | ||
title: "Rush Benchmarks" | ||
vignette: > | ||
%\VignetteIndexEntry{Rush Benchmarks} | ||
%\VignetteEngine{quarto::html} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
|
||
|
||
## Push Task | ||
|
||
Pushing a running task to the database is a fast operation. | ||
|
||
```{r} | ||
data = rbindlist(list( | ||
small = results[["push_running_tasks_small"]], | ||
large = results[["push_running_tasks_large"]] | ||
), idcol = "task_size") | ||
ggplot(data, aes(x = size, y = median_runtime, color = task_size)) + | ||
geom_point() + | ||
geom_line() + | ||
scale_x_log10() + | ||
scale_y_log10() + | ||
labs(x = "Number of cached tasks", y = "Median runtime (ms)") + | ||
theme_minimal() | ||
``` | ||
|
||
|
||
## Fetch Results | ||
|
||
The fastest way to retrieve new results is to use the `$fetch_new_results(fields = "ys")` method with `data_format = "list"`. | ||
If we need the results as a `data.table`, we can use the `data_format = "data.table"`. | ||
The `$fetch_new_results()` add new results to the cache to minimize the runtime when fetching the results again. | ||
|
||
We measure the runtime of fetching one new result depending on the cache size. | ||
The runtime increase slightly with the number of cached tasks. | ||
The runtime difference between a `list` and a `data.table` is negligible. | ||
|
||
```{r} | ||
data = rbindlist(list( | ||
list = results[["fetch_new_results_cache_list"]], | ||
data.table = results[["fetch_new_results_cache_data_table"]]), | ||
idcol = "data_format") | ||
ggplot(data, aes(x = size, y = median_runtime, color = data_format)) + | ||
geom_point() + | ||
geom_line() + | ||
scale_x_log10() + | ||
scale_y_log10() + | ||
labs(x = "Number of cached tasks", y = "Median runtime (ms)") + | ||
theme_minimal() | ||
``` | ||
|
||
We can also retrieve new results and return them with the cached task with the `$fetch_finished_tasks(fields = "ys")` method. | ||
|
||
We measure the time to retrieve one new result and the n cached tasks. | ||
The `data_format = "data.table"` runs `rbindlist()` on the tasks. | ||
This operation gets more expensive with the number of cached tasks. | ||
|
||
```{r} | ||
data = rbindlist(list( | ||
list = results[["fetch_results_cache_list"]], | ||
data.table = results[["fetch_results_cache_data_table"]]), | ||
idcol = "data_format") | ||
ggplot(data, aes(x = size, y = median_runtime, color = data_format)) + | ||
geom_point() + | ||
geom_line() + | ||
scale_x_log10() + | ||
scale_y_log10() + | ||
labs(x = "Number of cached tasks", y = "Median runtime (ms)", title = "Fetch new results with cache and data.table") + | ||
theme_minimal() | ||
``` | ||
|
||
## Fetch Tasks And Results | ||
|
||
When we need the results and the tasks we use the `$fetch_finished_tasks()` method without the `fields` argument. | ||
|
||
We measure the time to retrieve one new task and the n cached tasks. | ||
The `data_format = "data.table"` increases more because the `rbindlist()` operation gets more expensive with more | ||
|
||
```{r} | ||
data = rbindlist(list( | ||
list = results[["fetch_tasks_cache_list"]], | ||
data.table = results[["fetch_tasks_cache_data_table"]]), | ||
idcol = "data_format") | ||
ggplot(data, aes(x = size, y = median_runtime, color = data_format)) + | ||
geom_point() + | ||
geom_line() + | ||
scale_x_log10() + | ||
scale_y_log10() + | ||
labs(x = "Number of cached tasks", y = "Median runtime (ms)") + | ||
theme_minimal() | ||
``` | ||
|
||
|
||
The overhead of the `rbindlist()` operation can be minimized by using `consistent = TRUE`. | ||
|
||
```{r} | ||
data = rbindlist(list( | ||
"TRUE" = results[["fetch_tasks_cache_data_table_consistent"]], | ||
"FALSE" = results[["fetch_tasks_cache_data_table"]]), | ||
idcol = "consistent") | ||
ggplot(data, aes(x = size, y = median_runtime, color = consistent)) + | ||
geom_point() + | ||
geom_line() + | ||
scale_x_log10() + | ||
scale_y_log10() + | ||
labs(x = "Number of cached tasks", y = "Median runtime (ms)", title = "Fetch new results with cache and data.table consistent") + | ||
theme_minimal() | ||
``` |
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
Oops, something went wrong.