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
63
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
15 JSON serializers for Ruby
okuramasafumi
1
83
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
31
How NOT to make your DSL terrible
okuramasafumi
0
250
オブジェクトしこう
okuramasafumi
2
200
Debugging Alba
okuramasafumi
1
170
Learning Ruby
okuramasafumi
5
530
How to build a conference for both newbies and seasoned devs
okuramasafumi
1
1.7k
Why doesn't Ruby have Boolean class?
okuramasafumi
4
2.1k
Writing Minitest clone in 30 minutes
okuramasafumi
0
480
Other Decks in Programming
See All in Programming
"型"のあるRailsアプリケーション開発 / Typed Rails application development
sinsoku
8
2.1k
CSC509 Lecture 01
javiergs
PRO
1
190
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
1.1k
M5Stack に色々な M5ユニットをつないで扱う為の新たなアプローチ
gob
0
200
GraphQLとGigaViewer for Apps
numeroanddev
4
850
CSC305 Lecture 01
javiergs
PRO
1
140
GitHub Copilot Workspace で我々のアプリ開発がどう変わるのか?
shuyakinjo
0
830
上手に付き合うコンポーネントテスト
quramy
3
1.2k
Beyond the RuboCop Defaults
koic
2
460
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
5
170
Интеграционное тестирование: как приручить хаос
mariyasaygina
0
450
Progressive Web Apps for Rails developers
siaw23
2
510
Featured
See All Featured
For a Future-Friendly Web
brad_frost
174
9.3k
How STYLIGHT went responsive
nonsquared
93
5.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
158
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
1
230
How GitHub Uses GitHub to Build GitHub
holman
472
290k
Facilitating Awesome Meetings
lara
49
6k
Happy Clients
brianwarren
96
6.6k
Adopting Sorbet at Scale
ufuk
73
8.9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
Producing Creativity
orderedlist
PRO
340
39k
The Invisible Customer
myddelton
119
13k
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!