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
55
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
200
Ruby 型別檢查工具簡介
johnlinvc
0
410
Swift Actor 實作探索
johnlinvc
0
140
用 mruby 來寫跨平台工具
johnlinvc
0
59
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
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
testcontainers のススメ
sgash708
1
120
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
Jakarta EE meets AI
ivargrimstad
0
240
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
Haze - Real time background blurring
chrisbanes
1
510
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
Making the Leap to Tech Lead
cromwellryan
133
9k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
KATA
mclloyd
29
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Six Lessons from altMBA
skipperchong
27
3.5k
Docker and Python
trallard
42
3.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
We Have a Design System, Now What?
morganepeng
51
7.3k
Optimising Largest Contentful Paint
csswizardry
33
3k
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 ڗ҃ᡅᡅ