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
APIのデータのマッピングを 約18倍速くした話
Search
magiepooh
February 22, 2018
Technology
2
930
APIのデータのマッピングを 約18倍速くした話
magiepooh
February 22, 2018
Tweet
Share
More Decks by magiepooh
See All by magiepooh
今さら角丸のTransition
magiepooh
0
1.1k
Google I/O Extended Tokyo 2018
magiepooh
2
1.5k
まだAPI定義管理で消耗してるの?〜Swaggerを用いた大規模アプリ時代のAPI定義管理とコードジェネレート〜
magiepooh
38
18k
RootBeer
magiepooh
0
780
Customize Error Message
magiepooh
0
780
Kotlin入門
magiepooh
2
1.7k
Adjust Full Screen
magiepooh
2
470
How to get size of NavigationBar and StatusBar
magiepooh
1
1.6k
How to detect phone call
magiepooh
0
1.6k
Other Decks in Technology
See All in Technology
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
160
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
950
[FOSS4G 2019 Niigata] AIによる効率的危険斜面抽出システムの開発について
nssv
0
310
Featured
See All Featured
Unsuck your backbone
ammeep
668
57k
Rails Girls Zürich Keynote
gr2m
94
13k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Building Your Own Lightsaber
phodgson
103
6.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Visualization
eitanlees
145
15k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Gamification - CAS2011
davidbonilla
80
5k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
KATA
mclloyd
29
14k
Thoughts on Productivity
jonyablonski
67
4.3k
Transcript
APIͷσʔλͷϚοϐϯάΛ 18ഒͨ͘͠ potatotips #48 @magie_pooh
ࣗݾհ ౻ాୖຏ @magie_pooh @magiepooh झຯɾಛٕ: ΫϥϑτϏʔϧɾຊञɾϚδοΫɾ࠵
ͱ͋ΔΞϓϦͷ։ൃத • ը໘ભҠ͕͍͕͋Δͳʔͱࢥͬͨ
ͱ͋ΔΞϓϦͷ։ൃத • ը໘ભҠ͕͍͕͋Δͳʔͱࢥͬͨ • Nexus5Xͱ͔Ͱඵ
ͱ͋ΔΞϓϦͷ։ൃத • ը໘ભҠ͕͍͕͋Δͳʔͱࢥͬͨ • Nexus5Xͱ͔Ͱඵ • SO-04G (5.0.2)Ͱը໘ભҠʹ20sec͘Β͍ɾɾ
None
ঢ়گ • Wi-Fiଓڥ • σʔλJSONܗࣜ • αΠζ1MB • Kotlin +
Moshi(=A modern JSON library for Android and Java)
ରࡦ
ରࡦ1ɿMoshi͕ѱ͍ͷͰʁ • moshi(moshi-kotlin: SquareJSONύʔα)ϦϑϨΫγϣϯ Λ༻͍͍ͯΔͨΊɺίετ͕ߴ͍ • KotshiΛ͏ • An annotations
processor that generates Moshi adapters from immutable Kotlin data classes. • https://github.com/ansman/kotshi
ରࡦ1ɿMoshi͕ѱ͍ͷͰʁ • moshi(moshi-kotlin: SquareJSONύʔα)ϦϑϨΫγϣϯ Λ༻͍͍ͯΔͨΊɺίετ͕ߴ͍ • KotshiΛ͏ • An annotations
processor that generates Moshi adapters from immutable Kotlin data classes. • https://github.com/ansman/kotshi => 20sec -> 12sec
ରࡦ2ɿΦϒδΣΫτੜ͕ଟ͗͢Δ • ྻͷதʹΦϒδΣΫτ͕େྔʹଘࡏ͍ͯͨ͠ { “hogeArray”: [ {“obj”: {123, 456.2}},… ]
}
ରࡦ2ɿΦϒδΣΫτੜ͕ଟ͗͢Δ • ྻͷதʹΦϒδΣΫτ͕େྔʹଘࡏ͍ͯͨ͠ => ΦϒδΣΫτ͡Όͳ͘ɺStringܕͷྻͷྻͰදݱ͢Δ { “hogeArray”: [ {“obj”: {123,
456.2}},… ] } { “hogeArray”: [ [“123”, “456.2”],… ] }
ରࡦ2ɿΦϒδΣΫτੜ͕ଟ͗͢Δ • ྻͷதʹΦϒδΣΫτ͕େྔʹଘࡏ͍ͯͨ͠ => ΦϒδΣΫτ͡Όͳ͘ɺStringܕͷྻͷྻͰදݱ͢Δ { “hogeArray”: [ {“obj”: {123,
456.2}},… ] } { “hogeArray”: [ [“123”, “456.2”],… ] } => 12sec -> 8.4secʢྻσʔλ͕ͦͦڊ େͩͬͨͨΊɺ͔ͳΓ͕ࠩग़ͨʣ
ରࡦ3: APIఆٛΛݟ͢ • ྻσʔλΛ̍ͭʹڞ௨ԽͰ͖Δɾɾɾʂ • ॏෳͨ͠ྻσʔλΛ4ͭड͚औ͍ͬͯͨ => 8.4sec -> 2.9sec
·ͱΊ1 • ΄΅Kotshiͷ͓͔͕͛ͩɺ20sec -> 2.9secʹͳͬͨ • େྔͷྻσʔλʹܕΛ͚ͭΔͷΑ͘ͳ͍ • ʮͦͷɺਓྨࢥ͍ग़ͨ͠ɻؒͷύϑΥʔϚϯεࠩҟ ͷڪාΛɻͦΕͰαϙʔτ͠ͳ͚Ε͍͚ͳ͍۶ৱΛɻʯ
• SO-04G (5.0.2): 2.9sec • SO-02G (4.4.4): 0.64sec
·ͱΊ2 • iOSͰͦ͜·Ͱύʔεʹ͕͔͔࣌ؒͬͯͳ͔ͬͨͷ͕ٙ • ͔ͯ͠͠ݹ͍ͩͱ͕͔͔࣌ؒΔʁ • ը໘ભҠΞχϝʔγϣϯ(Shared Element Transition)͕͋Δͱɺ 2.9secͰ͘ײ͡ͳ͍
• ͦΕͰɺ2.9sec͔͔Δͷ͕ݏͩͬͨͷͰɺେྔͷྻͷऔಘ ผAPIʹΓग़ͨ͠ɻʢͦΕͰ1.2sec͘Β͍·ͰॖΊͯ18ഒͷύ ϑΥʔϚϯεվળୡɾɾʣ