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
66
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
A suggestion for the future of RDoc
okuramasafumi
1
52
15 JSON serializers for Ruby
okuramasafumi
2
100
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
34
How NOT to make your DSL terrible
okuramasafumi
0
260
オブジェクトしこう
okuramasafumi
2
200
Debugging Alba
okuramasafumi
1
180
Learning Ruby
okuramasafumi
5
540
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
Other Decks in Programming
See All in Programming
データマイグレーションの成功戦略~サービスリニューアルで失敗しないための実践ガイド~
tkzwtks
8
770
もう実家に手頃な情シス娘は不要!Bedrockでもう一人の娘を作る
komakichi
0
120
GrafanaのHTTP API を眺めてみよう
rinchoku
0
280
コードレビューと私の過去と未来
jxmtst
0
290
Hi, have you met Kotlin Multiplatform? | DevFest Vienna 2024
prof18
0
180
선언형 UI를 학습할 때 알아둬야하는 키워드들
l2hyunwoo
0
150
レイトレ合宿10 レンダラー紹介 / Renderer Introduction, Ray Tracing Camp 10
shocker_0x15
0
510
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
370
データフレームライブラリ徹底比較
daikikatsuragawa
2
110
Pythonによるイベントソーシングへの挑戦と現状に対する考察 / Challenging Event Sourcing with Python and Reflections on the Current State
nrslib
3
1.3k
DjangoNinjaで高速なAPI開発を実現する
masaya00
0
530
[KR] Server Driven Compose With Firebase
skydoves
2
200
Featured
See All Featured
Writing Fast Ruby
sferik
626
60k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.7k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Practical Orchestrator
shlominoach
186
10k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
23k
Typedesign – Prime Four
hannesfritz
39
2.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
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!