Skip to content

Commit

Permalink
shave off subsetting overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Jan 2, 2025
1 parent e041600 commit e6cfbc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Use a more lookup-efficient data structure for `tar_runtime$file_info` (#1398).
* Fall back on vector aggregation without names (#1401, @guglicap).
* Reduce overhead in `tar_outdated()` by at least 33% (#1408).
* Speed up representation of file sizes in metadata (#1408).
* Speed up representation of file sizes in metadata (#1408). This may slow down the next call to `tar_make()` in existing pipelines, but the new file size format will update in the metadata during that call, and then `tar_make()` should be faster after that.

# targets 1.9.1

Expand Down
12 changes: 8 additions & 4 deletions R/class_outdated.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ outdated_class <- R6::R6Class(
self$register_outdated(target_get_name(target))
}
},
process_target = function(name) {
target <- pipeline_get_target(self$pipeline, name)
process_target = function(name, pipeline) {
target <- pipeline_get_target(pipeline, name)
if_any(
inherits(target, "tar_pattern"),
self$process_pattern(target),
Expand All @@ -181,8 +181,12 @@ outdated_class <- R6::R6Class(
run = function() {
self$start()
queue <- self$scheduler$queue
while (queue$should_dequeue()) {
self$process_target(self$scheduler$queue$dequeue())
should_dequeue <- queue$should_dequeue
dequeue <- queue$dequeue
pipeline <- self$pipeline
while (should_dequeue()) {
name <- dequeue()
self$process_target(name, pipeline)
}
self$end()
},
Expand Down

0 comments on commit e6cfbc3

Please sign in to comment.