fru: a Rust random forest for R and Python, up to thousands of times faster than scikit-learn

2026-08-11

A Rust random forest for R and Python that keeps only ntree/mtry, runs a few to thousands of times faster than scikit-learn as cores scale, and adds a novel fast permutation-importance algorithm.

What problem this solves

Random forest remains one of the most reliable tools for tabular data. Gradient-boosted trees stole the spotlight, but random forest is still a first pick when samples are modest, features are messy, and interpretability matters. The catch is the implementations: R's randomForest is single-threaded and slow on larger data; scikit-learn's version scales poorly and can get slower as threads increase; ranger is fast, but the three disagree on how importance is scored, so results do not line up across libraries.

Kursa is familiar to R users as the author of Boruta, a feature-selection method. This SoftwareX paper introduces fru, a random forest he built with Piwoński from the ground up in Rust. The goal is not another benchmark winner; it is a forest that is stable, correct, fast, and able to scale across cores and into production. The R package is on CRAN, and Boruta already uses fru as its backend.

Method

fru's philosophy is "expose only the original hyperparameters": just trees (count, default 500) and tries (features tried per split, i.e. mtry). No extra-trees, no extra regularization. Fewer knobs means stable, reproducible behaviour across versions and languages.

Key engineering choices:

Results

The paper reports relative speed; the exact per-dataset timing tables are in the ScienceDirect full text, which blocked the datacenter IP and was not retrieved directly. The magnitude below comes from the authors' own project docs, the same source as the benchmark:

ComparisonFinding
vs scikit-learnA few times to several thousand times faster; gap widens with cores
CoverageClassification, regression, OOB prediction
ImportancePermutation importance (custom-accelerated); no Gini importance
EcosystemR (CRAN, reverse dependency of Boruta), Python (fru-arrow)

The point is the trend, not a fixed multiplier: scikit-learn's forest scales poorly across threads, while fru keeps consuming cores, so the larger the data and the more the cores, the bigger fru's edge. Exact per-dataset numbers belong to the paper's full text.

Why it matters

For anyone running scikit-learn or R on tabular models, fru is a much faster drop-in backend, especially for workloads that retrain repeatedly: feature selection (Boruta is exactly repeated forest training), hyperparameter search, batch scoring in production. Boruta's switch to fru means this popular feature-selection method now ships Rust speed by default.

The engineering posture is the other lesson: factor the algorithm into a crate shared by R and Python, make importance a reproducible parallel implementation, and deliberately narrow the API to its minimum. That is a clean template for rewriting classic algorithms in a systems language beyond Python and R. Gradient boosting and nearest neighbors, old algorithms whose value lives in the implementation, fit the same mold.

Limitations

Terms

Source

What people are saying

All paper explainers