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
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
CSC509 Lecture 12
javiergs
PRO
0
160
Jakarta EE meets AI
ivargrimstad
0
170
Macとオーディオ再生 2024/11/02
yusukeito
0
370
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
みんなでプロポーザルを書いてみた
yuriko1211
0
260
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
It's Worth the Effort
3n
183
27k
A Tale of Four Properties
chriscoyier
156
23k
Building Applications with DynamoDB
mza
90
6.1k
RailsConf 2023
tenderlove
29
900
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
The Pragmatic Product Professional
lauravandoore
31
6.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
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 ڗ҃ᡅᡅ