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
63
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
210
Ruby 型別檢查工具簡介
johnlinvc
0
410
Swift Actor 實作探索
johnlinvc
0
140
用 mruby 來寫跨平台工具
johnlinvc
0
60
Actor model 簡介
johnlinvc
0
160
一起玩 Helm 3
johnlinvc
1
100
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
170
Life of a Cell
johnlinvc
0
1.4k
Other Decks in Programming
See All in Programming
為你自己學 Python
eddie
0
520
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
return文におけるstd::moveについて
onihusube
1
1.4k
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
150
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
450
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
950
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
快速入門可觀測性
blueswen
0
500
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
Featured
See All Featured
Bash Introduction
62gerente
610
210k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Building Your Own Lightsaber
phodgson
104
6.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Mobile First: as difficult as doing things right
swwweet
222
9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
3
180
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 ڗ҃ᡅᡅ