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
Masatoshi Kubode
February 07, 2024
Programming
1
2k
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
ComposeでのShared Element Transition / Shared Element Transition in Compose
kubode
0
170
Data Bindingの移行を楽にする / Easier migration of Data Binding
kubode
0
450
Compose Shadow Alternative
kubode
0
160
アイコンをComposeにする / Compose the Icons
kubode
0
360
デザインシステムのCompose実装 / Design system Compose implementation
kubode
0
440
KMMのCI/CD
kubode
3
690
WantedlyでのCompose導入 / Introducing Jetpack Compose at Wantedly
kubode
1
380
DroidKaigi/conference-app-2022へのContributionが楽しかった話 / Contributing DroidKaigi app was fun!
kubode
0
940
継続的な依存性のアップデートにより得られたこと / What we have learned from continuous dependency updates
kubode
0
390
Other Decks in Programming
See All in Programming
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Go製Webアプリケーションのエラーとの向き合い方大全、あるいはやっぱりスタックトレース欲しいやん / Kyoto.go #50
utgwkk
2
140
PHPはいつから死んでいるかの調査
chiroruxx
1
400
What We Can Learn From OSS
inouehi
0
420
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
430
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
680
Java 22 Overview
kishida
1
190
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
9
4.1k
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
350
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
800
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
370
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1356
200k
Writing Fast Ruby
sferik
621
60k
Testing 201, or: Great Expectations
jmmastey
28
6.4k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Code Review Best Practice
trishagee
55
15k
BBQ
matthewcrist
80
8.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
187
16k
KATA
mclloyd
15
12k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
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.