Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Railsbench - Rdoc Generation - Microbenchmarks - Proposal to Enable VWare Resizing Objects - Shrinking RVALUE

Ruby Central via YouTube

Overview

Explore the intricacies of Ruby's memory optimization in this RubyConf 2021 talk by Peter Zhu and Matt Valentine-House. Delve into Ruby's current memory model, its limitations, and the proposed Variable Width Allocation project. Learn about RVALUE structure, heap page organization, object allocation, garbage collection processes, and CPU cache performance. Discover how moving system heap memory into Ruby heap memory can reduce allocations and improve control over memory layout. Examine different string allocation techniques, size pools, and the impact on Shopify's production environment. Gain insights into methodologies for benchmarking and testing, including railsbench and rdoc generation. Understand the potential benefits and challenges of implementing Variable Width Allocation in Ruby, including object resizing capabilities and RVALUE shrinking.

Syllabus

Intro
RVALUE structure
Ruby Object Structure
Heap page structure
Building the freelist
Allocating Ruby objects
Ruby's garbage collector
Marking phase
Marking example
Sweeping phase
Sweeping example
Compact phase
Compaction algorithm
Compaction example
Two different categories of Strings
Allocating an embedded string
Allocating a heap allocated string
CPU caches
CPU cache properties
Ruby cache performance
Overhead of malloc
The Variable Width Allocation project
Variable Width cache performance
RClass Allocation
Size pools
Types of String allocation
Allocating a short string
Allocating a longer string
Resizing a string
Shopify production
Methodology
railsbench
rdoc generation
Microbenchmarks
Proposal to enable VWA
Resizing objects
Shrinking RVALUE

Taught by

Ruby Central

Reviews

Start your review of Railsbench - Rdoc Generation - Microbenchmarks - Proposal to Enable VWare Resizing Objects - Shrinking RVALUE

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.