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
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
RyuNen344
May 13, 2023
Technology
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
RyuNen344
May 13, 2023
More Decks by RyuNen344
See All by RyuNen344
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
230
せめて、ネイティブらしく
ryunen344
2
3.2k
Cache Me If You Can
ryunen344
3
9.1k
WindowInsetsだってテストしたい
ryunen344
2
410
サプライチェーン攻撃に備える
ryunen344
1
3.8k
Okioに愛を込めて
ryunen344
3
3k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
2.1k
Xcode Meets Gradle
ryunen344
0
450
K/NとNSKeyedArchiverと私
ryunen344
0
630
Other Decks in Technology
See All in Technology
Master Dataグループ紹介資料
sansan33
PRO
1
4.9k
When Does a Local Qwen Start to Break
morshoto
0
110
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
150
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
0
130
DMMブックスのNext.js化を加速させるAI活用 / Migrating DMM Books to Next.js with AI
kentarom
1
310
AI駆動開発を組織で促すために
lycorptech_jp
PRO
7
9.2k
いかに伝えるか 〜新卒エンジニアの教育のための、ライトノベル活用の一例
ikedon
1
170
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
AIエージェントを雇う前に決める5つのこと
knishioka
1
140
いま好きなこと 最初はそんなに好きじゃなかった #tamagawadev
nishiuma
1
200
Bet AI Day 2026丨How We Bet AI: AIとともに働く場をつくる
layerx
PRO
1
1.7k
[DroidKaigi 2026] Making UI specifications visible: Android UI development in the AI agent era supported by Compose Screenshot Testing and galleries
syarihu
0
450
Featured
See All Featured
Paper Plane
katiecoart
PRO
2
53k
It's Worth the Effort
3n
188
29k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
57k
Odyssey Design
rkendrick25
PRO
2
790
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
360
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
510
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Transcript
Θ͔ͬͨؾʹͳΔɺCoroutine1.7.0ͷ νϟϯωϧͷύϑΥʔϚϯε্ 2023.05.13 KotlinConf 2023 Global in Kyoto Bunjiro Miyoshi
About Me • teamLab Inc.ॴଐ • (ࣗশ)ϚϧνϓϥοτϑΥʔϜܳਓ • ࠷ۙGoogle/TinkͷKMMϥούʔϥΠϒϥϦ࡞ͬͨ •
https://github.com/RyuNen344/tink-kmm
kotlinx.coroutine 1.7 ϦϦʔε͞Ε·ͨ͠Ͷ
Release Note
Release Note runTestͷdefault timeout͕60s͔Β10sʹมߋ͞ΕͨΓ
Release Note Kotlin NativeʹDispatchers.IO͕ొ
Release Note Kotlin NativeͷOld Memory Model͕আ͞Εͨ
Release Note Channelͷ࠶࣮
͢͜ͱɾ͞ͳ͍͜ͱ • ͢͜ͱ • چ࣮ɾ৽࣮ͷҧ͍ • ;ΜΘΓͱͨ͠Lock freeपΓͷ • ͞ͳ͍͜ͱ
• Lock freeपΓͷఆٛతʹਖ਼͍͠ղઆ • kumagi͞Μͷࢿྉ͕ͱͯษڧʹͳΓ·͢ • https://www.docswell.com/s/kumagi/ZP99EQ-lock-free • Ktorͷ3rd PartyϥΠϒϥϦͷӨڹ
ͳͥ࠶࣮ #1 • σʔλߏConcurrent Double Linked List • ͦͦޡͬͨཧΛݩʹ࣮ͯ͠ •
อकੑͷ • ઢܗԽՄೳੑͷ • ૢ࡞͕ஞ࣮࣍ߦ͞Ε͍ͯΔ͜ͱͷอূ
ͳͥ࠶࣮(Double Linked List) #1 ઌ಄ͱ࠷ޙͷϙΠϯλΛอ࣋ w w w w
ͳͥ࠶࣮(Double Linked List) #1 ཁૉྡ͢ΔͷϙΠϯλΛอ࣋
ͳͥ࠶࣮(Double Linked List) #1
ͳͥ࠶࣮(Double Linked List) #1 ৽͍͠ཁૉͷੜ DoubleLinkedListࣗମͷઌ಄ͱ چઌ಄ͷཁૉͷྡ͢ΔཁૉΛߋ৽
ͳͥ࠶࣮ #2 • ࣮͕ෳࡶʹͳ͍ͬͯͯbyte code size, dex sizeʹѱӨڹ • DCAS,
N-word CASͰ࣮ • ֦ுੑɺਖ਼֬ੑɺύϑΥʔϚϯεʹ͕͋Δ • CASɿCompare And Swap જࡏతͳσʔλڝ߹ͷ͕ൃੜͨ͠߹ͷਪଌͱमਖ਼Λࠔʹ͍ͯͨ͠
ͳͥ࠶࣮(Compare And Swap) #2
ͳͥ࠶࣮(Compare And Swap) #2 Pointerͷٙࣅίʔυ
ͳͥ࠶࣮(Compare And Swap) #2 PointerͷͱPointerʹೖͬͯΔ͖ΛνΣοΫ w w
ͳͥ࠶࣮(Compare And Swap) #2 ظͲ͓Γͷ͕Pointerʹ֨ೲ͞Ε͍ͯͨΒߋ৽
ͳͥ࠶࣮(D-Compare And Swap) #2
ͳͥ࠶࣮(D-Compare And Swap) #2 ظͲ͓Γͷ͕Pointerʹ֨ೲ͞ΕΔ·ͰԿCAS
ͲͷΑ͏ʹ࠶࣮ • σʔλߏྻͰ࣮ • ΦϒδΣΫτૢ࡞Fetch And Addʹมߋ
ͲͷΑ͏ʹ࠶࣮(Fetch And Add) Pointerʹೖ͍ͬͯͨݹ͍ΛҰ࣌อଘͯ͠ॲཧΛ࣮ߦ
ͲͷΑ͏ʹ࠶࣮(Fetch And Add) Ұ࣌อଘͨ͠ݹ͍Λݺͼग़͠ݩʹฦ٫
࠶࣮ͯ͠Ͳ͏ͳΔ • ҰൠతͳڥͰ10 ʙ 25%ߴԽ
·ͱΊ • 1.7.0ͰChannelࣗମͷ࠶࣮͕ͳ͞ΕͯύϑΥʔϚϯε্͕ͨ͠ • (Opt)BroadcastChannelܥΛআ͢Δ४උ͕ͬͨ • (Opt)͜ͷ࠶࣮ͷ͓͔͛ͰsemaphoremutexपΓͷվળೖͬͯ ͍Δ
͍͞͝ʹ ࢿྉ࡞ͬͯͨΒ1.7.1ϦϦʔε͞Εͨ😂
Ҿ༻ • https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.7.0 • https://github.com/Kotlin/kotlinx.coroutines/issues/3621 • https://github.com/Kotlin/kotlinx.coroutines/pull/3103 • https://arxiv.org/abs/2211.04986