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
850
Kotlin Serializationことはじめ
slme
August 24, 2019
Tweet
Share
More Decks by slme
See All by slme
ViewModel SavedState
slme
1
110
EXIA.pdf
slme
0
81
Other Decks in Technology
See All in Technology
社内勉強会運営のコツ
senoo
6
1.1k
なぜ NOT A HOTEL が Web3 に取り組むのか - NOT A HOTEL TECH TALK
ynunokawa
0
160
Garoon 開発チーム / Garoon development team
cybozuinsideout
PRO
1
2.9k
AWS パートナー企業でテクニカルサポートに従事して2年経ったので思うところをまとめてみた
kazzpapa3
3
1.3k
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
4
1.7k
日本におけるデータエンジニアリングのこれまでとこれから
foursue
9
1.8k
DevOpsDays History and my DevOps story
kawaguti
PRO
6
1k
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
1.8k
PHPカンファレンス小田原2024
ysknsid25
2
650
A (short) History of AI
harishpillay
0
100
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
1
400
アプリがつくるNOT A HOTELブランド
hokuts
0
450
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Ruby is Unlike a Banana
tanoku
95
10k
Fireside Chat
paigeccino
19
2.6k
YesSQL, Process and Tooling at Scale
rocio
162
13k
Visualization
eitanlees
135
14k
Unsuck your backbone
ammeep
662
57k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
15
1.4k
Designing with Data
zakiwarfel
95
4.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
Designing the Hi-DPI Web
ddemaree
276
33k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
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非推奨あり - ベンチマークは対して大きな変化はない
ご清聴ありがとうございました