Skip to content

⚡ Performance Enhancement: data.table, future, furrr, Rcpp #14

@pjt222

Description

@pjt222

Summary

Enhance rendering performance using modern R performance packages.

Current State

  • Rendering works but could be faster
  • Using base R for computation
  • Single-threaded execution

Proposed Enhancements

1. data.table

  • Replace data frame operations with data.table for faster manipulation
  • Memory-efficient operations on spiral point data

2. future + furrr

  • Parallel computation for Voronoi tessellation
  • Non-blocking async operations
  • Better utilization of multi-core CPUs

3. Rcpp

  • C++ implementation of hot paths:
    • Fermat spiral point generation
    • Coordinate transformations
    • Bounded cell filtering
  • Potential 10-100x speedup for computation-heavy operations

Implementation Plan

  • Benchmark current performance baseline
  • Add data.table for data manipulation
  • Implement future/furrr for parallel Voronoi computation
  • Profile and identify Rcpp candidates
  • Create Rcpp implementations for bottlenecks
  • Benchmark improvements

Dependencies to Add

renv::install(c("data.table", "future", "furrr", "Rcpp"))

Files to Modify

  • R/utils/spiral_math.R - Core computation
  • R/modules/ui_plot.R - Rendering pipeline
  • New: src/ folder for Rcpp code

Labels

enhancement, performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions