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
1
120
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
0
16
Writing documentation can be fun with plugin system
okuramasafumi
0
160
Alba: Why, How and What's So Interesting
okuramasafumi
0
330
Why did my proposals get rejected?
okuramasafumi
1
610
A suggestion for the future of RDoc
okuramasafumi
1
250
15 JSON serializers for Ruby
okuramasafumi
2
310
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
60
How NOT to make your DSL terrible
okuramasafumi
0
500
オブジェクトしこう
okuramasafumi
2
400
Other Decks in Programming
See All in Programming
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
2
840
Optimizing JRuby 10
headius
0
520
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
1
4.2k
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
790
Ruby on Railroad: The Power of Visualizing CFG
ydah
0
270
Youtube Lofier - Chrome拡張開発
ninikoko
0
2.5k
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
120
状態と共に暮らす:ステートフルへの挑戦
ypresto
3
1k
設計の本質:コード、システム、そして組織へ / The Essence of Design: To Code, Systems, and Organizations
nrslib
10
3.5k
The Evolution of the CRuby Build System
kateinoigakukun
1
740
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
1
1.6k
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
210
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
[RailsConf 2023] Rails as a piece of cake
palkan
54
5.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
GitHub's CSS Performance
jonrohan
1030
460k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.4k
A better future with KSS
kneath
239
17k
Adopting Sorbet at Scale
ufuk
76
9.3k
A designer walks into a library…
pauljervisheath
205
24k
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!