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
82
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
450
A suggestion for the future of RDoc
okuramasafumi
1
66
15 JSON serializers for Ruby
okuramasafumi
2
110
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
39
How NOT to make your DSL terrible
okuramasafumi
0
290
オブジェクトしこう
okuramasafumi
2
210
Debugging Alba
okuramasafumi
1
190
Learning Ruby
okuramasafumi
5
560
How to build a conference for both newbies and seasoned devs
okuramasafumi
1
1.8k
Other Decks in Programming
See All in Programming
Realtime API 入門
riofujimon
0
150
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
130
CSC509 Lecture 13
javiergs
PRO
0
110
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
Jakarta EE meets AI
ivargrimstad
0
750
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
140
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
110
初めてDefinitelyTypedにPRを出した話
syumai
0
440
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
970
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Featured
See All Featured
Fireside Chat
paigeccino
34
3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
A Philosophy of Restraint
colly
203
16k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Optimizing for Happiness
mojombo
376
70k
How STYLIGHT went responsive
nonsquared
95
5.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Building Your Own Lightsaber
phodgson
103
6.1k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Scaling GitHub
holman
458
140k
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!