Speeding up NMatrix by 100x
summary
NMatrix gets a ground-up reimplementation renamed NumRuby that claims a 100x speedup claim over the old mixed C/C++/Ruby codebase by cutting copies and using a clean C backend via the Ruby C extensions and LAPACK/BLAS wrappers. Benchmarks show parity with Numo NArray on elementwise ops and faster QR factorization (7s vs 14.7s on ~5M elements). A companion Ruby-Sparse implements COO CSR CSC and diagonal formats with conversions to NMatrix and NArray and initial graph and sparse linear‑algebra work.
AI-written summary · about
chapters (21)
- 0:00Intro
- 0:21About me
- 1:59Rubyplot
- 2:37NMatrix benchmarks
- 4:14How NumRuby is the solution
- 4:45Matrix addition
- 5:00Matrix subtraction
- 5:16Determinant
- 5:29Factorization
- 6:52nmatrix struct
- 7:51Elementwise operations
- 9:25Stride calculation example
- 10:37Broadcasting example
- 11:43Linear Algebra
- 13:05A simple example usage
- 15:11Sparse matrices
- 16:53Usage example of Ruby-Sparse
- 18:18NMatrix conversion
- 19:05Numo-NArray conversion
- 19:59Graph module • Implements graph algorithm with graph stored in a sparse
- 21:29Future work
related talks
39mProgress of Ruby/Numo: Numerical Computing for Ruby
23mHigh Performance GPU Computing with Ruby
28mData Science in Ruby? Is it possible? Is it Fast? Should we use it?
36mRuby Supercomputing: Using The GPU For Massive Performance Speedup
39m"300x faster ruby"
21mScientific Computing in Ruby
41mHigh Performance Ruby
18mPerformance Optimization in Ruby
