Skip to content

Conversation

jangorecki
Copy link
Member

@jangorecki jangorecki commented Sep 10, 2025

closes #7305

using same mechanism as we use for openmp throttle.
verbose nicely reports all details.

also updated timings in manual, which were 3 years old.

library(data.table)

x = rnorm(1024)
n = 10L
f = mean

options(datatable.verbose=TRUE)
setDTthreads(1)
system.time(frollapply(x, n, f, simplify=unlist))
#frollapply running on single CPU thread
#   user  system elapsed 
#  0.004   0.000   0.005 

setDTthreads(2)
system.time(frollapply(x, n, f, simplify=unlist))
#frollapply run on 2 CPU threads throttled to 1 threads, input length 1024
#   user  system elapsed 
#  0.005   0.000   0.004 

x = rnorm(1025)
system.time(frollapply(x, n, f, simplify=unlist))
#frollapply running on 2 CPU threads
#   user  system elapsed 
#  0.005   0.010   0.013 

x = rnorm(2048)
setDTthreads(3)
system.time(frollapply(x, n, f, simplify=unlist))
#frollapply run on 3 CPU threads throttled to 2 threads, input length 2048
#   user  system elapsed 
#  0.000   0.005   0.014 

options(datatable.verbose=FALSE)
x = rnorm(1024)
setDTthreads(1)
system.time(for (i in 1:1e3) frollapply(x, n, f, simplify=unlist))
#   user  system elapsed 
#  4.540   0.005   4.546 
setDTthreads(2)
system.time(for (i in 1:1e3) frollapply(x, n, f, simplify=unlist))
#   user  system elapsed 
#  4.572   0.004   4.578

This work was supported by the Medical Research Council, UK [grant number 1573].

@jangorecki jangorecki added this to the 1.18.0 milestone Sep 10, 2025
Copy link

github-actions bot commented Sep 10, 2025

No obvious timing issues in HEAD=frollapply-throttle
Comparison Plot

Generated via commit b786d4a

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 3 minutes and 0 seconds
Installing different package versions 43 seconds
Running and plotting the test cases 2 minutes and 18 seconds

Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.09%. Comparing base (251e88d) to head (b786d4a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7306   +/-   ##
=======================================
  Coverage   99.09%   99.09%           
=======================================
  Files          83       83           
  Lines       16073    16085   +12     
=======================================
+ Hits        15928    15940   +12     
  Misses        145      145           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jangorecki jangorecki merged commit 4c09687 into master Sep 14, 2025
12 checks passed
@jangorecki jangorecki deleted the frollapply-throttle branch September 14, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frollapply could throttle DTthreads

1 participant