Learn R Programming

data.table.threads (version 1.0.0)

findOptimalThreadCount: Function that finds the optimal (fastest) thread count for different data.table functions

Description

This function finds the optimal thread count for running data.table functions with maximum efficiency.

Usage

findOptimalThreadCount(rowCount, colCount, times = 10, verbose = FALSE)

Value

A data.table of class data_table_threads_benchmark containing the optimal thread count for each data.table function.

Arguments

rowCount

The number of rows in the data.table.

colCount

The number of columns in the data.table.

times

The number of times the benchmarks are to be run.

verbose

Option (logical) to enable or disable detailed message printing.

Details

Iteratively runs benchmarks with increasing thread counts and determines the optimal number of threads for each data.table function.

Examples

Run this code
# Finding the best performing thread count for each benchmarked data.table function
# with a data size of 1000 rows and 10 columns:
(optimalThreads <- data.table.threads::findOptimalThreadCount(1e3, 10))

Run the code above in your browser using DataLab