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
940
APIのデータのマッピングを 約18倍速くした話
magiepooh
February 22, 2018
Tweet
Share
More Decks by magiepooh
See All by magiepooh
今さら角丸のTransition
magiepooh
0
1.2k
Google I/O Extended Tokyo 2018
magiepooh
2
1.5k
まだAPI定義管理で消耗してるの?〜Swaggerを用いた大規模アプリ時代のAPI定義管理とコードジェネレート〜
magiepooh
38
18k
RootBeer
magiepooh
0
790
Customize Error Message
magiepooh
0
780
Kotlin入門
magiepooh
2
1.7k
Adjust Full Screen
magiepooh
2
480
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
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
160
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
210
podman_update_2024-12
orimanabu
1
260
UI State設計とテスト方針
rmakiyama
2
310
.NET 9 のパフォーマンス改善
nenonaninu
0
500
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Faster Mobile Websites
deanohume
305
30k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
A Philosophy of Restraint
colly
203
16k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
KATA
mclloyd
29
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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ഒͷύ ϑΥʔϚϯεվળୡɾɾʣ