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
為什麼 App 卡卡的
Search
Johnlin
November 08, 2020
Programming
2
1.1k
為什麼 App 卡卡的
iPlayground 2020 Keynote
Johnlin
November 08, 2020
Tweet
Share
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
49
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
200
Ruby 型別檢查工具簡介
johnlinvc
0
400
Swift Actor 實作探索
johnlinvc
0
130
用 mruby 來寫跨平台工具
johnlinvc
0
56
Actor model 簡介
johnlinvc
0
160
一起玩 Helm 3
johnlinvc
1
100
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
160
Life of a Cell
johnlinvc
0
1.3k
Other Decks in Programming
See All in Programming
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
Jakarta EE meets AI
ivargrimstad
0
510
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
310
初めてDefinitelyTypedにPRを出した話
syumai
0
400
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
65
4.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
The Invisible Side of Design
smashingmag
298
50k
Building Adaptive Systems
keathley
38
2.3k
RailsConf 2023
tenderlove
29
900
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Statistics for Hackers
jakevdp
796
220k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Transcript
Safe Area @johnlinvc ҝॄኄ App 㠡㠡తʁ John Lin ( @johnlinvc
)
Safe Area @johnlinvc John Lin (@johnlinvc) • ኺ iPhone OS
2 ։࢝ሜ Obj-Cɻ • લࡏ West Pharmaceutical ᙛ DevOpsɻ ሢሜڅ։ᚙऀʢแؚࣗݾʣ༻త۩ɻ ؐ༗मผਓత Bugɻ
Safe Area @johnlinvc تᓣჩՃࣾ܈׆ಈ Functional Tuesday Ruby Taiwan Elixier Taiwan
Taipei.py Clojure Taiwan
Safe Area @johnlinvc Swift Taipei • ኺ 2016 1/14։࢝ɼࡏ㑌ݸ݄తୈҰݸᜌ፨ೋᎯ㭎ɻ౸લቮៃ㭎ྃ
ۙ 60 ࣍ᡉ။ɻ • ఏڙେՈҰݸೳⴺ์ᱷ౼ Swift తํɻ • ڧྗ㐸ٻߨऀதɻཁ Swift ඍ༗૬᮫తඇৗᓣܴɻ
Safe Area @johnlinvc ৗৗࡏݚ౼။্ڗ RubyConf CN
Safe Area @johnlinvc iPlayground • ڈྃ iOSDC Japan ޙ᧷ಘᖯጯ֘༗ •
ᙛങྃ iosdc.tw Ҭɻ • ޙိܾఆཁڣ iPlaygroundɻ iosdc.tw ။ಋ౸ iplayground.io
Safe Area @johnlinvc ୈҰ࣍ߨ Keynote • ᅳ㚎֎ߨྃेز࣍ɼײँओ㭎ํڅզṜݸػ။ိᙛ Keynote ߨऀɻ •
ऴԙՄҎ༻ Keynote ိ၏ Keynote ྃɻ
Safe Area @johnlinvc
Safe Area @johnlinvc iPlayground తओ • ᙛવؐੋᅴ៴ࡏ App (ෆੋ˖ʽҰʽҰ) ্,ɻ
• ڗ૬᮫తመʢҏཕʣៃᱛɻ • ୳ࡧߋଟ։ᚙ্తՄೳੑɻ
Safe Area @johnlinvc Ұݸ App తᑍ݅ 1. ූ߹ۀधٻɻ 2. ༻ىိॱखɻ
3. Optional<ඬ྄తఔࣜᛰ>ɻ
Safe Area @johnlinvc Ұݸ App తᑍ݅ 1. ූ߹ۀधٻɻ 2. ༻ىိॱखɻ
3. Optional<ඬ྄తఔࣜᛰ>ɻ
Safe Area @johnlinvc ၏աҰਞࢠతਓػհ໘ݚڀ
Safe Area @johnlinvc ॄኄੋॱख • ֎᧺ඬ྄ • ᔒ༗ਓྨతૢ࡞ྲྀఔ • ߦҝූ߹༻ऀ༬ظ
Safe Area @johnlinvc ॄኄੋॱख • ֎᧺ඬ྄ • ᔒ༗ਓྨతૢ࡞ྲྀఔ • ߦҝූ߹༻ऀ༬ظ
Safe Area @johnlinvc ༻ऀ༬ظతߦҝ • ༻ऀత༌ೖཁ༗దᙛతճᰶɻ • ྗճᰶɻ • ࢹ᧷ճᰶɻ
Safe Area @johnlinvc ྗճᰶ • ଧ伴൫త࣌ީ௨ৗෆ။伴൫ɻ ػց伴൫తྗճᰶᩋզ၇҈ىိൺֱਅመɻ • iPhone 7/8
্తHome伴ɻ ଖመੋݻఆతɼᯪಈᩋզ၇ײ᧷༗҈Լڈతײ᧷ɻ
Safe Area @johnlinvc ࢹ᧷ճᰶ • ᦊນ্త༻ऀհ໘ੋࢹ᧷ճᰶతҰ෦ɻ • ᴍ㐝ޙతճᰶɼ૾ੋબᎩޙతᏓ৭ɼ ҃ੋҠಈ౸ԼҰݸᙘ໘ɻ •
䇪ಈޙతճᰶɼ૾ੋᰖֹࣔ֎త㚎༰ɼ ҃ੋҠಈᙘ໘্తᱪɻ
Safe Area @johnlinvc ॄኄੋ㠡㠡తʁ • ䷩㘸㠡㠡తɻ • ᙘ໘ෆ࿈᠃ɻ • ༌ೖ౸ࢹ᧷ճᰶత࣌ؒࠩଠɻ
Safe Area @johnlinvc ᙘ໘త࿈᠃ੑ • ਅመੈքతᱪతҠಈੋ࿈᠃తɻ • ࡏᰖࣔᱪҠಈ࣌ɼՌਓ؟ೳⴺᚙݱ தؒ༗ඃաతᙘ໘ɻब။᧷ಘ㠡㠡తɻ
Safe Area @johnlinvc ਓ؟తහ㕔 • 1991 తݚڀɻࢹਆៃࡉ๔ሣᦊນરᗜతጯɻ • ༻ిۃఁଌਓᱪࢹਆៃሣ CRT
ᦊນરᗜతጯɻ • Human electroretinogram responses to video displays, fluorescent lighting, and other high frequency sources
Safe Area @johnlinvc ਓ؟ՄҎ౸ 76 Hz తરᗜ
Safe Area @johnlinvc ༌ೖ౸ࢹ᧷ճᰶత࣌ؒࠩ • ਅመੈքతᱪडྗޙ။ཱࠁҠಈɼ ᔒ༗Կ࣌ؒࠩɻ • ༻ऀૢ࡞ޙաྃଠٱ࠽㗞ੜࢹ᧷ճᰶతɼ ब။᧷ಘ㠡㠡తɻ
Safe Area @johnlinvc ճᰶཁଟշ࠽ⴺշ • 2015 తݚڀɼ ଌࢼ༻ऀሣᨀ߇༌ೖతࢹ᧷ճᰶԆᬌ త༰ɻ •
How Much Faster is Fast Enough? User Perception of Latency & Latency Improvements in Direct and Indirect Touch
Safe Area @johnlinvc ճᰶཁଟշ࠽ⴺշ • ሣԙᴍ㐝䇪፮༗ෆಉత༰ɻ • ᴍ㐝 69 ms
• 䇪፮ 11 ms
Safe Area @johnlinvc ҝॄኄ။㠡㠡తʁ
Safe Area @johnlinvc > զ၇ိҰݸ؆ᄸతɿզ၇ॴሜաతఔࣜɼେଟੋኺ಄౸ඌɺ ҰߦҰߦԟԼࣥߦɼࣥߦඟɼఔࣜब݁ଋʀಹኄɼҰݸ GUI ጯ༻ఔࣜ —ແੋզ၇ݱࡏਖ਼ࡏላशత iOS
ᢛ Mac OS Xɺؐੋଖଞฏ—ҝॄኄ ෆੋଧ։೭ޙҰ࿏ࣥߦ౸ఈ݁ଋɼࣕੋ။ఀཹࡏᦊນதզ၇ૢ࡞ʁ KKBOX iOS/Mac OS X جૅ։ᚙڭࡐ
Safe Area @johnlinvc Run loop
Safe Area @johnlinvc Ұݸ loop ཫ໘ཁ၏తࣄ ߋ৽ᙘ໘ Auto Release ᨀᚙ
Timer Ꮕࣄ݅ ႔ཧࣄ݅
Safe Area @johnlinvc Run Loop ᔒ༗ݻఆతिظ • ཁ౸ݱ༗త loop 䋯೭ޙɼ࠽။䋯ԼҰݸ
loopɻ • Ռࡏ Event Handler ཫ໘၏ྃଠଟࣄɼब။ᩋԼҰݸ loop Ԇޙ։ ࢝ɻ 0 35 70 105 140 Loop 1 Loop 2 Loop 2
Safe Area @johnlinvc Ұݸ loop Ֆྃଠଟ࣌ؒ • ႔ཧಈա 11 ms
=> ಈ㠡㠡త • ႔ཧᴍ㐝ա 69 ms => ᴍ㐝㠡㠡త
Safe Area @johnlinvc ղܾํ๏ • ॏෳར༻ view/cell/asset ɻ • ར༻ଟ֩৺႔ཧثɻ
Safe Area @johnlinvc ղܾํ๏ • ॏෳར༻ view/cell/asset ɻ • ར༻ଟ֩৺႔ཧثɻ
Safe Area @johnlinvc ॏෳ༻ View/Cell • UICollectionView dequeueReusableCell(withReuseIdentifier:for:) • UIImage
Cached: init(named:) Not Cached: init(contentsOfFile:) • MKMapView dequeueReusableAnnotationView(withIdentifier:)
Safe Area @johnlinvc Reusable • https://github.com/AliSoftware/Reusable • ՄҎ༻ Type Safe
తํ๏ိఆٛ Reuse identifier. final class CustomCell: UITableViewCell, Reusable tableView.register(cellType: theCellClass.self) let cell = tableView.dequeueReusableCell(for: indexPath) as MyCustomCell
Safe Area @johnlinvc ղܾํ๏ • ॏෳར༻ view/cell/asset ɻ • ར༻ଟ֩৺႔ཧثɻ
Safe Area @johnlinvc ଟ֩৺႔ཧث • iPhone 12 ্༗ 6 ݸ
CPU ֩৺ɻ • ՄҎಉ࣌ࣥߦଟݸࣥߦॹɻ • ཁࣄࢄ౸֤ݸ֩৺ɼबՄҎॖ run loop ႔ཧ࣌ؒɻ
Safe Area @johnlinvc ࡏผత thread ၏ࣄతํ๏ • Dispatch • Combine
Safe Area @johnlinvc ࡏผత thread ၏ࣄతํ๏ • Dispatch • Combine
Safe Area @johnlinvc Dispatch • ༻ Obj-C block & Swift
closure ိ෧ Thread APIɻ • جຊ্बੋ code 㟚౸ queue ཫɼሏब။㢨㟬ࣥߦɻ
Safe Area @johnlinvc Dispatch • ༻ DispatchQueue.async बՄҎᩋ code ࡏผత
Thread 䋯ɻ DispatchQueue.global(qos: .background).async { // code to run }
Safe Area @johnlinvc Refactoring legacy and concurrent thread API with
Testing
Safe Area @johnlinvc ࡏผత thread ၏ࣄతํ๏ • Dispatch • Combine
Safe Area @johnlinvc Combine • ༻એࠂࣜతޠ๏ိఆٛࢿྉᢛࣄ݅႔ཧྲྀఔɻ • Scheduler ՄҎઃఆཁࡏ䬟Ұݸ Thread
্႔ཧࢿྉᢛࣄ݅ɻ
Safe Area @johnlinvc Combine • ՄҎ༻ receive(on:) Thread/Queue Just(1)
.map { _ in print(Thread.isMainThread) } // true .receive(on: DispatchQueue.global()) .map { print(Thread.isMainThread) } // false .sink { print(Thread.isMainThread) } // false
Safe Area @johnlinvc ଧ։ Combine తҾ№֖ိ
Safe Area @johnlinvc UIKit ೳࡏ main Thread ݺڣ • UIKit
ᔒ༗ Thread Safetyɻ • ࡏผతํݺڣత။༗ Error ɻ • UI API called on a background thread: -[UIView initWithFrame:]
Safe Area @johnlinvc ආ໔ UIKit thread • ࡏ Dispatch
ཫ༻ DispatchQueue.main ճ Main Thread • ࡏ Combine ཫ༻ receive(on:) ճ Main Thread • ༻ SwiftUI
Safe Area @johnlinvc ආ໔ UIKit thread • ࡏ Dispatch
ཫ༻ DispatchQueue.main ճ Main Thread • ࡏ Combine ཫ༻ receive(on:) ճ Main Thread • ༻ SwiftUI
Safe Area @johnlinvc Swift UI • એࠂࣜత UI Frameworkɻ •
ލฏɻ • Auto Layoutɻ
Safe Area @johnlinvc ༻ Swift UI struct ContentView: View {
@State var clickCount : Int = 0 var body: some View { Button(action: add) { Text("\(clickCount)") .font(.system(size: 120)) } } func add() { clickCount += 1 } }
Safe Area @johnlinvc ༻ Swift UI struct ContentView: View {
@State var clickCount : Int = 0 var body: some View { Button(action: add) { Text("\(clickCount)") .font(.system(size: 120)) } } func add() { clickCount += 1 } }
Safe Area @johnlinvc ༻ Swift UI struct ContentView: View {
@State var clickCount : Int = 0 var body: some View { Button(action: add) { Text("\(clickCount)") .font(.system(size: 120)) } } func add() { DispatchQueue.global().async{ clickCount += 1 } } }
Safe Area @johnlinvc ༻ Swift UI struct ContentView: View {
@State var clickCount : Int = 0 var body: some View { Button(action: add) { Text("\(clickCount)") .font(.system(size: 120)) } } func add() { DispatchQueue.global().async{ clickCount += 1 } } }
Safe Area @johnlinvc ༻ Swift UI • ߋ৽UI ௨ৗੋಁա @State
property wrapperɻ • @State ੋ Thread safe తɻՄҎኺԿ Thread मվଞతᆴɻ
Safe Area @johnlinvc ղܾํ๏ • ॏෳར༻ view/cell/asset ɻ • ར༻ଟ֩৺႔ཧثɻ
Safe Area @johnlinvc ෆಓኺ䬟։࢝վʁ
Safe Area @johnlinvc ෧ʂ෧ʂ࠶෧ʂզཁҝ෧େࢣʂ
Safe Area @johnlinvc ์։ಹݸ MVC
Safe Area @johnlinvc खखት㟬༻ Clean Swift ॏߏ MVC, ฒସ֩৺ఔࣜᛰḤ ሜᄸݩଌࢼ
Safe Area @johnlinvc ዑվᆦʁዑվଠٱʁ
Safe Area @johnlinvc ኺᘐཱ։ᚙ౸େܕሢҊత CI/CD ߈ུ
Safe Area @johnlinvc iOS ։ᚙऀ 13 ഒٕ
Safe Area @johnlinvc ࡏผత thread ၏ࣄతํ๏ • Dispatch • Combine
Safe Area @johnlinvc Ռ֩৺શᕝྃʁ • ਅత༗ଠଟࣄཁ၏ɼबࢉ༻ྃ Dispatch/Combine/async ။㠡ʁ • ਅతᔒ༗㭎๏ྃ䆩ʁ
Safe Area @johnlinvc 㟬༗ᔒ༗աʁ • ᙛఔࣜ㠡ॅత࣌ީɼॴ༗తૢ࡞။㠡ॅɻ • ༗Ұछૢ࡞ෆ။ɼܥ౷㚎ݐతɻ૾ੋ Home 伴ɻ
Safe Area @johnlinvc ҝॄኄ Home 伴័ੋ༗༻ʁ • ཧ্ɼᙛఔࣜ㠡ࡏ run loop
தత࣌ީɼੋᔒ㭎๏Ꮕᨀ߇ࣄ݅తɻ • طવᔒ㭎๏Ꮕࣄ݅ɼ্తखጯ֘ᔒ༗Կ࡞༻࠽ሣʁ
Safe Area @johnlinvc ిᡵՊላܯࠂ ిᡵՊላ ࠷৽తᐽՍ ೈᱪఔࢣ
Safe Area @johnlinvc Darwin-XNU macOS & iOS ༻తఈ ֩৺ Mach
ੋඍ֩৺ BSD ఏڙ POSIX & Unix API
Safe Area @johnlinvc ࣌ܥ౷ • iPhone 12 ༗ݸ֩৺ɼୠੋզ၇ჟՄҎಉ࣌䋯্ඦݸ DispatchQueue/Threadɻ •
ҼҝҰݸ֩৺্ՄҎಁա࣌ܥ౷䋯աҰݸthreadɻ
Safe Area @johnlinvc ࣌ܥ౷ Thread
Safe Area @johnlinvc Context Switch • લఔࣜతهԱᱪଘثత㚎༰ ه㑚ىိɻ • ԼҰݸఔࣜతهԱᱪଘثత㚎༰
ኺه㑚ཫճ෴ɻ • PC (Program CounterʣࢦԼҰݸఔࣜɼ बੋ߇੍ᒟަڅԼҰݸఔࣜɻ Thread
Safe Area @johnlinvc Context Switch • ࡞ۀܥ౷ཁዎኄ߇੍ᒟ፤ճိʁ • ߹࡞ࣜɿࡏಛఆ࡞ۀ࣌ •
ඇ߹࡞ࣜɿ࡞ۀܥ౷ܾఆ Thread
Safe Area @johnlinvc Context Switch • ࡞ۀܥ౷ཁዎኄ߇੍ᒟ፤ճိʁ • ߹࡞ࣜɿࡏಛఆ࡞ۀ࣌ •
ඇ߹࡞ࣜɿ࡞ۀܥ౷ܾఆ Thread
Safe Area @johnlinvc ߹࡞ࣜ • ᙛఔࣜࣥߦ system call ࣌ (
IO, ݐཱ Threadʣ။߇੍ᒟަؐڅ࡞ۀ ܥ౷ɼṜݸ࣌ީब༗ػ။၏ɻ • ᙛఔࣜࣥߦඇ๏ࢦྩ࣌ (1/0, ᩇෆ߹๏తهԱᱪҐஔʣ။ᨀᚙ trapɼṜ ࣌ީܥ౷။औಘ߇੍ᒟɼ༗ػ။၏ɻ
Safe Area @johnlinvc ߹࡞ࣜత • ՌఔࣜӬԕෆݺڣsystem call ɻ૾ੋԼ໘Ṝᒬɼब။Ӭԕᔒ㭎๏ ɻ •
for true { 1+1} • MacOS 9 Ҏલੋ༻߹࡞ࣜɼॴҎᄸҰఔࣜ༗Մೳ㠡ॅݸܥ౷
Safe Area @johnlinvc Run loop ੋҰछ߹࡞ࣜ • 㑌Ұ࣍త loop ཁ
Event Handler ႔ཧ࠽။ਐԼҰݸ loopɻ • Dispatch ཁݱࡏత task ႔ཧ࠽။ަग़߇੍ᒟɻ • ॴҎ༗ԿҰݸ Event/Task ႔ཧଠٱɼ App ब။㠡ॅɻ
Safe Area @johnlinvc Context Switch • ࡞ۀܥ౷ཁዎኄ߇੍ᒟ፤ճိʁ • ߹࡞ࣜɿࡏಛఆ࡞ۀ࣌ •
ඇ߹࡞ࣜɿ࡞ۀܥ౷ܾఆ Thread
Safe Area @johnlinvc ඇ߹࡞ࣜ • ܥ౷ཁ߇੍ᒟަڅԼҰݸ࣌ɼ။ઃఆҰݸߗᱪܭ࣌ثɻ • ܭ࣌ث࣌ؒ౸ޙ။ᨀᚙҰݸTrapɼ߇੍ᒟڧ੍ަڅܥ౷ɻ • Ռ࣌ؒ౸લबަճ߇੍ᒟతɼबॏஔܭ࣌ثɻ
Safe Area @johnlinvc 0x8BADF00D • Ռ༗ఔࣜաྃٱᔒ༗ਐలɻ • Darwin ။⬏ಈ WatchDog
Timerɻಹݸఔࣜऴࢭɻ • ࡨޡᛰबੋ 0x8BADF00D, ate bad foodɻ
Safe Area @johnlinvc Darwin-XNU ༻ඇ߹࡞ࣜ • ᙛᄸҰఔࣜ㠡ॅత࣌ީɼෆ။Өڹଖଞఔࣜɻ • ᙛ App
㠡ॅత࣌ީɼ SpringBoard ෆ။ඃӨڹɼॴҎ Home ؐੋՄҎ ਖ਼ৗӡ࡞ɻ
Safe Area @johnlinvc ᩋ Run loop ༻ඇ߹࡞? • ઃఆ㑌ݸ loop
ՄҎ༻ိ႔ཧ Event త࣌ؒɻᙛ࣌ؒ౸త࣌ީबڧ੍ަ ग़߇੍ᒟɻ • ԼҰݸ loop ࠶᠃߶߶ᔒ၏తࣄɻ
Safe Area @johnlinvc Bringing Theory Into Practice: A Userspace Library
for Multicore Real-Time Scheduling • ࡏ Linux త Userspace ্ࣥߦత noncooperative schedulerɻ • ՄҎࡏ༻ऀతఔࣜ㚎ٖ OS తɻ • बੋ㘸ɼՄҎᩋ UI ෆ။㠡ॅɻ
Safe Area @johnlinvc Մೳతመ࡞ํ๏ • ಛత Combine Scheduler ɼᙛ࣌ؒ౸बఀࢭɼԼҰݸ loop
ࣗಈॏ ࢼɻ • Swift main branch መᱛதత Async/Await + Actorɼᙛᔒ༗ڞڗهԱᱪ ࣌ɼtask बՄҎॏࢼᔒ༗ෆཁత෭࡞༻ɻ
Safe Area @johnlinvc run loop ඇ߹࡞త᠍ᴍ • ᔒሜతɼՄೳ။༗ଟ࣍త෭࡞༻ɼ૾ੋ print 䋯ྃၷ࣍ɻ
• ᙘ໘Մೳ။༗ෆతߋ৽ɻҼҝߋ৽౸ҰबඃதᏗྃɻ
Safe Area @johnlinvc UIKit SwiftUI ඇ߹࡞ࣜ run loop ༏ᴍ
࠷ख़ ՄҎॴ༗తࣄ Ҡ౸ଖଞ Thread ሜग़ိతAppҰఆෆ ။㠡㠡 ᠍ᴍ ࠷ሜग़ෆ။㠡㠡 తApp ؐෆख़ ᙘ໘Մೳߋ৽ෆશ ૾ؐᔒ༗ਓ၏
Safe Area @johnlinvc ॄኄੋ App 㠡㠡 ? • ᙘ໘తߋ৽සԙ 76Hz
• ಈա 11 ms ᔒ༗ճᰶ • ᴍ㐝ա 69 ms ᔒ༗ճᰶ
Safe Area @johnlinvc App 㠡㠡త • Run loop తҰݸ loop
䋯ྃଠٱɻ䇪౸ྃԼҰݸ loopɻ • ᔒ㭎๏ߋ৽ᙘ໘ɻ • ᔒ㭎๏Ꮕ༌ೖɻ
Safe Area @johnlinvc App 㠡㠡త႔ཧํ๏ • ॖӡࢉ࣌ؒɼ༻շऔɼCell Reuseɻ • ༻
GCD, Combine ိࣄҠ౸ run loop ֎ࣥߦɻ
Safe Area @johnlinvc ະိల • Async / Await ՄҎᩋզ၇ߋ༰қࣄҠ౸ଖଞ Thread
႔ཧɻ • 㘸ෆఆՄҎࡏ App 㚎၏ඇ߹࡞ࣜ schedulingɼ༗ڵझతՄҎိҰ ىݚڀݚڀɻ
Safe Area @johnlinvc References • https://stackoverflow.com/questions/18738453/how-does-the-compiler- know-a-button-has-been-pressed/18739381 • https://www.objc.io/issues/3-views/moving-pixels-onto-the-screen/ •
https://zonble.gitbooks.io/kkbox-ios-dev/content/responder/run_loop.html • http://pages.cs.wisc.edu/~remzi/OSTEP/ • https://yuriktech.com/2020/03/07/User-Space-Scheduling/ • Apple Developer Documentation
Safe Area @johnlinvc References • https://semianalysis.com/apples-a14-packs-134-million-transistors- mm2-but-falls-far-short-of-tsmcs-density-claims/ • https://ckitakishi.com/2016/08/17/WatchDog- %E6%9C%BA%E5%88%B6/
Safe Area @johnlinvc Q&A • ӨยతҐஔࡏ https://bit.ly/3n4rZO4 • John Lin
Twitter: @johnlinvc • ᓣܴိ Swift Taipei ڗ҃ᡅᡅ