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
Kotlin Serializationことはじめ
Search
slme
August 24, 2019
Technology
1
1k
Kotlin Serializationことはじめ
slme
August 24, 2019
Tweet
Share
More Decks by slme
See All by slme
ViewModel SavedState
slme
1
140
EXIA.pdf
slme
0
130
Other Decks in Technology
See All in Technology
LangfuseではじめるAIアプリのLLMトレーシング
codenote
0
140
AOAI で AI アプリを開発する時にまず考えたいこと
mappie_kochi
1
660
問 1:以下のコンパイラを証明せよ(予告編) #kernelvm / Kernel VM Study Kansai 11th
ytaka23
3
500
クラウドネイティブ環境の脅威モデリング
kyohmizu
2
410
Ninno LT
kawaguti
PRO
1
120
CARTA HOLDINGS エンジニア向け 採用ピッチ資料 / CARTA-GUIDE-for-Engineers
carta_engineering
0
27k
TanStack Start 技術選定の裏側 / Findy-Lunch-LT-TanStack-Start
iktakahiro
0
120
Sleep-time Compute: LLM推論コスト削減のための事前推論
sergicalsix
1
100
大規模サーバーレスプロジェクトのリアルな零れ話
maimyyym
3
210
genspark_presentation.pdf
haruki_uiru
1
250
伝わるコードレビュー
abenben
1
110
OPENLOGI Company Profile for engineer
hr01
1
26k
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Making Projects Easy
brettharned
116
6.2k
Producing Creativity
orderedlist
PRO
344
40k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
420
The Art of Programming - Codeland 2020
erikaheidi
54
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Transcript
KotlinSerialization ことはじめ 概要と入門
$ whoami - slme(スルメ) - @slme_not_found - DMM.com Androidエンジニア -
新卒エンジニア
What is Kotlin Serialization
What is it - 1.3以降あたりで導入された機能 - CBOR, JSON, ProtoBufをサポート -
100%Kotlin実装 - カスタムシリアライザで自作できる - reflectionを使わない
None
Http clientとの組み合わせは?
Ktor Client
Retrofit https://github.com/JakeWharton/retrofit2-kotlinx-serialization-converter
Retrofitの場合: Moshi, Gson Ktorの場合: Kotlin Serialization
Moshi, GsonはOkioを使っている ↓ OkHttpを扱う際はそちらのほうが相性が良い
About Kotlin Serialization - メリット - 100% Kotlin実装 - 色々な形式を扱う時に単一で済む
- カスタムシリアライザで自作できる - デメリット - JSON単一で扱うかつKotlin/JVMならばMoshiで良い感 - Serializationを用いてkamlのように作ってもJVM依存が生まれたりする - 一部不安定 or 非推奨がある
速度は?
https://github.com/wizzardo/json-benchmarks
形式にもよるが大きな変化はない
まとめ - KotlinMPPを考えないかつJSONのみであればMoshiなどで充分 - @Seralizableを使うことでJSON以外にもserialize可能になる - 一部 不安定or非推奨あり - ベンチマークは対して大きな変化はない
ご清聴ありがとうございました