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
K2への完全移行結果 / Results of complete migration to K2
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masatoshi Kubode
February 07, 2024
Programming
2
7k
K2への完全移行結果 / Results of complete migration to K2
https://potatotips.connpass.com/event/307311/
Masatoshi Kubode
February 07, 2024
Tweet
Share
More Decks by Masatoshi Kubode
See All by Masatoshi Kubode
3リポジトリーを2ヶ月でモノレポ化した話 / How I turned 3 repositories into a monorepo in 2 months
kubode
0
140
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
2
1.3k
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
660
技術を根付かせる / How to make technology take root
kubode
1
460
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
590
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
1
1.4k
Make your Android app into Multiplatform app
kubode
0
210
ウォンテッドリーにおけるモバイルアプリ開発 / iOSDC Japan 2024 Sponsor Session
kubode
1
1.4k
Jetpack ComposeのBottomSheetとの戦い / Fight with BottomSheet of Jetpack Compose
kubode
0
1.1k
Other Decks in Programming
See All in Programming
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.5k
CSC307 Lecture 10
javiergs
PRO
1
690
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
3
380
並行開発のためのコードレビュー
miyukiw
2
2.2k
atmaCup #23でAIコーディングを活用した話
ml_bear
4
730
CSC307 Lecture 11
javiergs
PRO
0
580
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
350
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
120
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
320
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
2
180
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
120
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
150
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
270
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
86
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.7k
Building Adaptive Systems
keathley
44
2.9k
Done Done
chrislema
186
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Raft: Consensus for Rubyists
vanstee
141
7.3k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
250
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.8k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
68
Transcript
© 2024 Wantedly, Inc. K2への完全移行結果 potatotips 86 2024/02/07 久保出雅俊
© 2024 Wantedly, Inc. wantedly.com/id/kubode X: @swiz_ard GitHub: @kubode
© 2024 Wantedly, Inc. 紹介 Wantedly Visit iOS, Android and
Web 気軽に会社訪問 ミッションや価値観への共感でマッチング • 給与や福利厚⽣などの条件ではなく、想いがあれば会社 の規模にとらわれない まず「話を聞きに⾏く」という新しい体験 • 個⼈と企業がフラットな⽬線で出会えることで、より魅 ⼒的な場所を⾒つけることが可能に
© 2024 Wantedly, Inc. 話すこと • K2完全有効化までの道のり • K2化を始める前との比較
© 2024 Wantedly, Inc. K2とは
© 2024 Wantedly, Inc. K2 • Kotlin 2.0のコンパイラー実装のこと • Kotlinのコードのコンパイル速度が最大2倍
• Kotlin 2.0の言語機能追加に対応しやすい • Kotlin 1.9から実験的に有効化できる
© 2024 Wantedly, Inc. K2を使うには • gradle.propertiesに以下を追加 kotlin.experimental.tryK2=true kapt.use.k2=true android.lint.useK2Uast=true
© 2024 Wantedly, Inc. これだけ
© 2024 Wantedly, Inc. と思ったら
© 2024 Wantedly, Inc. 落とし穴 • kaptはKotlin言語バージョン2でサポートされていない • kaptがある限り完全移行とは言えない >
Task :features:discover:kaptGenerateStubsDebugKotlin w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.
© 2024 Wantedly, Inc. K2移行プロジェクト
© 2024 Wantedly, Inc. K2に必要なこと • kapt -> KSP ◦
Dagger Hilt ◦ Room ◦ 自作のコード生成 • Data Binding
© 2024 Wantedly, Inc. kapt -> KSP • HiltやRoomは特に問題なし •
自作のコード生成はKSPに書き換え ◦ インターフェースは大きく変わるが、コードを生成するロジックは変更なし
© 2024 Wantedly, Inc. Data Bindingの移行
© 2024 Wantedly, Inc. Data Bindingの移行 https://speakerdeck.com/kubode/easier-migration-of-data-binding 具体的な手法は 過去の発表で
© 2024 Wantedly, Inc. Data Bindingの移行 • 移行ツールを作成、作業を大きく減らす • 単純作業化して分担
• 品質はレビューよりも自動テストとQAに委ねる
© 2024 Wantedly, Inc.
© 2024 Wantedly, Inc.
© 2024 Wantedly, Inc. 前後比較
© 2024 Wantedly, Inc. 前後比較 Data Binding移行開始前 VS K2有効化後 CPU:
Apple M1 Max, Memory: 64GB • クリーンビルド ◦ $ ./gradlew clean && ./gradlew compileVisitQaDebugAndroidTestSources --no-daemon --no-build-cache --no-configuration-cache --max-workers=1 • --max-workers=1(並列ビルド無効) • --scan
© 2024 Wantedly, Inc. ビルド時間 Before After % クリーンビルド 100s
92s 8% 🎉 max-worker=1 191s 155s 19% 🎉 max-worker=1 Kotlin関連Taskのみ※ 177s 117s 34% 🎉 ※--scanあり、KotlinCompile&Kapt&Ksp
© 2024 Wantedly, Inc. --scan Before After この辺を並列化しないと効果が薄い
© 2024 Wantedly, Inc. まとめ
© 2024 Wantedly, Inc. まとめ • K2について説明 • kaptというかData Bindingが大変
• ビルド時間は改善するが改善の余地あり ◦ 並列化の効率を上げるほうが効果が高い • Kotlin 2がきても安心
© 2024 Wantedly, Inc.