Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Class.new is all you need
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shia
April 22, 2026
Technology
720
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Class.new is all you need
RubyKaigi 2026 LT
Shia
April 22, 2026
More Decks by Shia
See All by Shia
猫の手も借りたい
riseshia
0
30
Good Enough Types: Heuristic Type Inference for Ruby
riseshia
1
4.9k
型を書かないRuby開発への挑戦
riseshia
0
6.2k
ひとつの開発環境
riseshia
0
210
Conquering Massive Traffic Spikes in Ruby Applications with Pitchfork
riseshia
0
420
スパイクアクセス対策としての pitchfork 導入
riseshia
0
1k
NewEngineering 2024 - 繋がっていくサービスを支える開発環境作り
riseshia
0
1.9k
Hotspot on Coverage
riseshia
0
310
差分ベースで効率的にテストを実行してみる
riseshia
1
840
Other Decks in Technology
See All in Technology
Confitura 2026
logico_jp
0
100
プラットフォームを「作る」、 チームに「入り込む」
sansantech
PRO
0
390
Claude起点の仕様駆動開発
tanakaseiya
0
220
企業の現実世界をグラフで写し取る
sansantech
PRO
0
200
地方移住と都心キャリアの両立は「金・時間・人」のリソースをフル活用すれば実現できる!〜Snowflake女子会 vol.8
snowwmn0824
0
140
あなたの知らないAmazon VPC Route Server/Amazon VPC Route Server you don't know about
masakiokuda
0
160
10年欲しかった音楽管理アプリを、AIと一緒に作りはじめた
judau
1
190
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
200
Making AI Agents Safe and Fast- Jev, Obsidian, and the Meta-Harness
x5gtrn
PRO
0
160
AIに会社の文脈を理解させる技術~上流工程・非エンジニアにも広げるハーネスエンジニアリング実践~
ochtum
0
190
Argo CDとAtlantisで実現するインフラ管理のセルフサービス化──小規模SREチームで支えるプラットフォーム
cassius7
0
250
ScotSecure West 2026 - Glasgow
raybugg
0
210
Featured
See All Featured
Believing is Seeing
oripsolob
1
230
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
730
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Product Roadmaps are Hard
iamctodd
55
13k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
490
How to Talk to Developers About Accessibility
jct
2
560
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Docker and Python
trallard
47
4.2k
Leo the Paperboy
mayatellez
10
2.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
550
Transcript
RubyKaigi 2026 LT Shia@STORES Class.new is all you need
SIM SANGYONG (@shia) - STORES Inc. - GitHub: @riseshia -
X: @riseshia Self Introduction 2
SIM SANGYONG (@shia) - STORES Inc. - GitHub: @riseshia -
X: @riseshia - And…Day 3!!! Self Introduction 3
"type-guessr" needed to collect info from project code at startup
and it was slow. So, I profiled and… Background 4
ko1: "Class.new is faster than them" shia: "…!?!?" Background 5
Target: Initialization speed - Data.define, Struct, Class - kwargs, positional
args - 1 ivar, 8 ivars Ruby 4.0.1 / linux / no YJIT So, benchmark it 6
Result 7 1 field 8 fields
- Class.new > Struct.new >> Data.define.new - kwargs are slow
- more ivars, more slower Observation 8
Observation 9 8 fields - Class.new > Struct.new >> Data.define.new
- kwargs are slow - more ivars, more slower Note: Class.new outperforms with YJIT
See perf results 10 "perf record -g --call-graph dwarf" Ruby
4.0.1 / linux / no YJIT / ivar 1 field
See perf results 11
See perf results 12
See perf results 13
See perf results 14
See perf results 15
- Is kwargs initialization optimized? - Create Hash for kwargs
on initialization or not - Is ivar access optimized? - Byte code caching with object shape applied or not - Does the object need to be frozen? Why?? 16
shia: "I found it really is.." ko1: "We optimize what
people use most, so yeah" shia: "That's absolutely true😂" After talk 17
I originally used Data because I vaguely assumed Data/Struct was
lighter than Class. Reality was different at least object initialization. Did you know that? Summary 18
〜Fin〜 19
🤔 20
If "Class" is the fastest, why not re-implement these with
it?? 🤔🤔🤔 How to speed up Struct or Data.define 21
Re-impl Struct with "Class", and benchmark again: (8 fields, YJIT
off/on) How to speed up Struct or Data.define 22
It’s really fast! Let’s submit this patch!!!
Let’s submit this patch!!! 24
Submit this patch…? 25
🫠 26
🚮 27
28 You can check the full benchmark & RubyStruct implementation!
https://github.com/riseshia/class-new-is-all-you-need Class.new might be all you need (if initialization perf matters)