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
84
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
Why did my proposals get rejected?
okuramasafumi
1
470
A suggestion for the future of RDoc
okuramasafumi
1
69
15 JSON serializers for Ruby
okuramasafumi
2
120
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
44
How NOT to make your DSL terrible
okuramasafumi
0
310
オブジェクトしこう
okuramasafumi
2
220
Debugging Alba
okuramasafumi
1
200
Learning Ruby
okuramasafumi
5
570
How to build a conference for both newbies and seasoned devs
okuramasafumi
1
1.9k
Other Decks in Programming
See All in Programming
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
350
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
testcontainers のススメ
sgash708
1
120
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
たのしいparse.y
ydah
3
120
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Security_for_introducing_eBPF
kentatada
0
110
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
240
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Code Review Best Practice
trishagee
65
17k
Making the Leap to Tech Lead
cromwellryan
133
9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Site-Speed That Sticks
csswizardry
2
190
Done Done
chrislema
181
16k
Documentation Writing (for coders)
carmenintech
66
4.5k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Mobile First: as difficult as doing things right
swwweet
222
9k
Fireside Chat
paigeccino
34
3.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
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!