Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Creating gems 101
Search
Masafumi Okura
September 05, 2024
Programming
2
130
Creating gems 101
Gem作成に関するトークです。
https://omotesandorb.connpass.com/event/328438/
Masafumi Okura
September 05, 2024
Tweet
Share
More Decks by Masafumi Okura
See All by Masafumi Okura
My KaigiEffect at RubyKaigi 2025, part 1
okuramasafumi
1
34
Writing documentation can be fun with plugin system
okuramasafumi
0
180
Alba: Why, How and What's So Interesting
okuramasafumi
0
360
Why did my proposals get rejected?
okuramasafumi
1
660
A suggestion for the future of RDoc
okuramasafumi
1
290
15 JSON serializers for Ruby
okuramasafumi
2
350
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
66
How NOT to make your DSL terrible
okuramasafumi
0
540
オブジェクトしこう
okuramasafumi
2
440
Other Decks in Programming
See All in Programming
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
160
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
110
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
120
プロダクト開発でも使おう 関数のオーバーロード
yoiwamoto
0
150
Go Modules: From Basics to Beyond / Go Modulesの基本とその先へ
kuro_kurorrr
0
110
C++20 射影変換
faithandbrave
0
400
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
220
AIエージェントによるテストフレームワーク Arbigent
takahirom
0
370
FormFlow - Build Stunning Multistep Forms
yceruto
1
160
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
2
130
TypeScript LSP の今までとこれから
quramy
1
500
Create a website using Spatial Web
akkeylab
0
260
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Balancing Empowerment & Direction
lara
1
290
GraphQLとの向き合い方2022年版
quramy
46
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to train your dragon (web standard)
notwaldorf
92
6.1k
Transcript
Creating gems 101 Omotesando.rb #101 OKURA Masafumi, 2024-09-05
101ճ։࠵ ͓ΊͰͱ͏ ͍͟͝·͢ʂʂʂ
101
ೖ
ೖgem࡞ Omotesando.rb #101 OKURA Masafumi, 2024-09-05
Dev.introduce(self) • ໊લɿ͓͓͘Β·͞;Έ • ॴଐɿϑϦʔϥϯε • ׆ಈɿKaigi on RailsνʔϑΦʔΨφΠβʔɺAlba gem࡞ऀɺOH!
MY RUBYISTSϙουΩϟετϝΠϯύʔιφϦςΟɺͳͲͳͲ • ࠓͷొஃͷഎܠɿFeikuͱ͍͏৽͍͠gemΛ࡞ͬͨͷͰɺͦͷྲྀΕ ʹ͍ͭͯ͝հ
None
gemΛ࡞Δͱ͖ʹ ·ͣߟ͑Δ͜ͱ
gemΛ࡞Δͱ͖ʹ·ͣߟ͑Δ͜ͱ • ཧ༝ • ΠϯλʔϑΣʔε • ໊લ
લఏ
Feiku https://github.com/okuramasafumi/feiku
Faker Έ͍ͨͳͭ
ཧ༝
ͳͥͦΕ͕ ΄͍͠ͷ͔
طଘͷͷͰ μϝͳͷ͔
Feikuͷ߹
???ɿ ʮFakerͷίʔυͬ ͯΞϨͰ͢ΑͶ͑ʯ
FakerͷίʔυΛ ݟͨࣗɿ ʮ…ʯ
FakerͷύϑΥʔ ϚϯεΛଌఆ
Comparison: feiku: 11239359.0 i/s ffaker: 1296337.9 i/s - 8.67x slower
faker: 10084.1 i/s - 1114.57x slower
1000ഒʂʁ
Comparison: feiku: 0 allocated ffaker: 637748 allocated - Infx more
faker: 98919397 allocated - Infx more
100MB!?
Faker::Name.name ͢Δ͚ͩͰʁ
ڥʹѱ͍ʂ
ஔ͖͑Α͏ʂ
ࣗͷΛ ࣗͰ͢
͕ࣗ΄͍͠ͷ Λ࡞Δ
ΠϯλʔϑΣʔε
Feikuͷ߹
Fakerʹ߹ΘͤΔ
͘ΘΕ͍ͯΔ ΠϯλʔϑΣʔε ʹ߹ΘͤΔ
ਓ৽͍͍͠ํ Λ֮͑ͨ͘ͳ͍
໊લ
໊લॏཁʂʂʂ
Feikuͷ߹
ॳͷҊɿ “Realer”
Fakerͷٯ
ࢥ͍͢ ʮ͕͢͞ʹฆΒΘ ͍͠ͳ͋ʯ
ࠔͬͨͱ͖ͷ ϩʔϚࣈදه
͓·͚ɿ Albaͷ߹
ίϯηϓτ ʮߴʯ
͍ͷ
͍ੜ͖
ࢲɿ ʮΞϗυϦͬͯ ࣌100kmͳͷʂʯ
ࢲɿ ʮ໊͔͠લ͕ Ξϗ͍͍ͬͯͶʯ
ΞϗυϦ
Albatross
Alba
FeikuͱAlbaͷ ڞ௨
͍ ൃԻ༰қ ͍֮͑͢
·ͱΊ
Creating gems 101 • ཧ༝ • ύϑΥʔϚϯεͳͲɺࣗͷΛࣗͰ͢ • ΠϯλʔϑΣʔε •
͢Ͱʹ͘ΘΕ͍ͯΔͷʹ߹ΘͤΔ • ໊લ • ͘ɺൃԻ͕༰қͰ໊͍֮͑͢લʹ͢Δ
Happy hacking!