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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masafumi Okura
September 05, 2024
Programming
180
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Creating gems 101
Gem作成に関するトークです。
https://omotesandorb.connpass.com/event/328438/
Masafumi Okura
September 05, 2024
More Decks by Masafumi Okura
See All by Masafumi Okura
Conference as a communication hub for all of us
okuramasafumi
0
62
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
170
Developing static sites with Ruby
okuramasafumi
1
440
Why doesn't Ruby have Boolean class - final version
okuramasafumi
0
410
Reading Rails 1.0 Source Code
okuramasafumi
0
370
RDoc meets YARD
okuramasafumi
4
270
Why doesn't Ruby have Boolean class?
okuramasafumi
0
63
My KaigiEffect at RubyKaigi 2025, part 1
okuramasafumi
1
110
Writing documentation can be fun with plugin system
okuramasafumi
0
280
Other Decks in Programming
See All in Programming
RTSPクライアントを自作してみた話
simotin13
0
630
Lessons from Spec-Driven Development
simas
PRO
0
220
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
170
A2UI という光を覗いてみる
satohjohn
1
150
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
740
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.7k
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
570
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.8k
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
110
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.2k
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
610
Mobile First: as difficult as doing things right
swwweet
225
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Building an army of robots
kneath
306
46k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
730
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
How to build a perfect <img>
jonoalderson
1
5.7k
Discover your Explorer Soul
emna__ayadi
2
1.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!