← Back to all sparks
C

cheapr

ANALYTICS
Velocity0.0

Simple Functions to Save Time and Memory

cheapr turned multi-threaded, and its next stop is a C++20 public API.

performanceparallelismsimdc-apidata-framesr-package
Current state
cheapr supplies lower-overhead replacements for base R's data manipulation primitives — subsetting, recycling, concatenation, attribute handling, data frame construction. Through 2025 it grew function by function: sset_df/sset_row/sset_col, list_as_df, cheapr_c, counts, str_coalesce, df_modify. The 1.5.0 release in April 2026 changed the nature of the package, adding parallelised math functions, user-settable thread counts, multi-threaded vector initialisers, and a SIMD-parallelised if_else_, with threading on by default at two threads.
Where it's heading
Two arcs run at once. The visible one is parallelism: what began as single-threaded C shortcuts is becoming a threaded compute layer, and the notes state the C/C++ API is mid-rewrite with a stable form promised at 2.0.0 behind a C++20 requirement. The quieter one is R C API compliance — 1.5.1 removed R_MissingArg, R_UnboundValue, Rf_findVar and Rf_findVarinFrame, the non-API entry points being closed off upstream. The 1.5.x patches since are narrow crash fixes, which reads as consolidation before the 2.0.0 break.
Prediction
Expect 2.0.0 to land the stable C/C++ API behind a C++20 toolchain floor, with more of the existing function surface threaded in the interim. The package has announced both moves in its own release notes.

Recent moves

  1. 1mo ago

    rep_len_ crash on shrinking lengths fixed

    A single crash fix where rep_len_(x, n) brought down the session when n was smaller than the input. Narrow patch work in the consolidation window after 1.5.0.

    View source ↗
  2. 4mo ago

    Non-API R internals removed

    Four non-API entry points — R_MissingArg, R_UnboundValue, Rf_findVar and Rf_findVarinFrame — are gone from the C sources. Invisible from R, but it is what keeps a package that exports C symbols to others viable as the public API narrows.

    View source ↗
  3. 4mo ago

    Parallelised math, thread control, and a C API rewrite

    ⚡ SPARK

    The release that redefines what cheapr is: a single-threaded shortcut library becomes a threaded compute layer, with the C/C++ API rebuilt underneath and a 2.0.0 break pre-announced. Everything in the 1.5.x line since has been consolidation on this foundation.

    View source ↗
  4. 1y ago

    Subsetting speedups; sset_col negative-index crash fixed

    Substantial speed gains in subsetting — the package's core claim — plus a fix for sset_col() crashing on negative subscripts. Incremental sharpening of the pre-parallelism single-threaded design.

    View source ↗
  5. 1y ago

    df_modify added; attribute helpers renamed for intent

    df_modify() lands as a fast path for adding and changing data frame columns, attrs_add/attrs_rm become attrs_modify/attrs_clear, and as_df is normalised to return a plain data.frame with three attributes. A correctness fix stops recycle from modifying lists in place.

    View source ↗
  6. 1y ago

    counts and str_coalesce added; reconstruct renamed to rebuild

    Two new primitives — fast unique-value counts and a vectorised first-non-empty-string helper — plus an integer64 subsetting method and rchk fixes. The reconstruct-to-rebuild rename is flagged as breaking, part of the naming cleanup that continues into 1.3.1.

    View source ↗