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
40
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
190
Ruby 型別檢查工具簡介
johnlinvc
0
390
Swift Actor 實作探索
johnlinvc
0
130
用 mruby 來寫跨平台工具
johnlinvc
0
56
Actor model 簡介
johnlinvc
0
160
一起玩 Helm 3
johnlinvc
1
98
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
150
Life of a Cell
johnlinvc
0
1.3k
Other Decks in Programming
See All in Programming
開発効率向上のためのリファクタリングの一歩目の選択肢 ~コード分割~ / JJUG CCC 2024 Fall
ryounasso
0
290
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
350
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
910
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
0
300
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
3
810
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
0
200
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
160
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
4
2.3k
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
10
2.2k
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
530
Java ジェネリクス入門 2024
nagise
0
500
offers_20241022_imakiire.pdf
imakurusu
1
270
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
59k
Code Review Best Practice
trishagee
64
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Automating Front-end Workflow
addyosmani
1365
200k
Making Projects Easy
brettharned
115
5.9k
GitHub's CSS Performance
jonrohan
1030
460k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
770
A Tale of Four Properties
chriscoyier
156
23k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
328
21k
Building an army of robots
kneath
302
42k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
360
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 ڗ҃ᡅᡅ