View source: R/setThreadCount.r
setThreadCount | R Documentation |
data.table
functionFunction to set the thread count for a specific data.table
function
setThreadCount(
benchmarkData,
functionName,
efficiencyFactor = 0.5,
verbose = FALSE
)
benchmarkData |
A |
functionName |
The name of the |
efficiencyFactor |
A numeric value between 0 and 1 indicating the desired efficiency level for thread count selection. 0 represents use of the optimal thread count (lowest median runtime) and 0.5 represents the recommended thread count. |
verbose |
Option (logical) to enable or disable detailed message printing. |
Sets the thread count to either the optimal (fastest median runtime) or recommended value (default) based on the chosen type argument for the specified data.table
function based on the results obtained from findOptimalThreadCount()
.
NULL.
# Finding the best performing thread count for each benchmarked data.table function
# with a data size of 1000 rows and 10 columns:
benchmarkData <- data.table.threads::findOptimalThreadCount(1e3, 10)
# Setting the optimal thread count for the 'forder' function:
setThreadCount(benchmarkData, "forder", efficiencyFactor = 1)
# Can verify by checking benchmarkData and getDTthreads():
data.table::getDTthreads()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.