Androidにおけるパフォーマンスチューニング実践
by
neonankiti
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
"OESPJEʹ͓͚Δ ύϑΥʔϚϯενϡʔχϯά࣮ફ @neonankiti
Slide 2
Slide 2 text
גࣜձࣾFiNC Technologies — Mobile Engineer(Android/iOS/Flutter) ೆཬ༐ؾ @neonankiti #εϊϘʔ #όεέ #Ωϟϯϓ #Γ #GoldGym ࣗݾհ
Slide 3
Slide 3 text
ύϑΥʔϚϯε՝ͷࢦఠ CTO ΞϓϦͷಈ࡞͓ͳ͍ʁͯ͘͠ɻ Θ͔Γ·ͨ͠ʂʂ σʔλফඅྔ͘ͳ͍ʁͯ͠ɻ ΊͬͪΌి৯ͬͯͳ͍ʂʁʂʁʂ
Slide 4
Slide 4 text
ͳΜ͔Θ͔ΒΜ͚ͲɺͬͯΈΔ͔
Slide 5
Slide 5 text
νʔϜͷ࠶ฤ Before After ػೳ1 ػೳ2 ػೳ3 ػೳ1 ػೳ2 ػೳ3 ڞ ௨ ج ൫
Slide 6
Slide 6 text
ڞ௨ج൫νʔϜര
Slide 7
Slide 7 text
ͳͥνʔϜΛ࠶ฤͨ͠ͷ͔ʁ νʔϜମ੍ػೳ(υϝΠϯ)୯Ґ →ػೳ୯ҐͰ͕ᐆດͳ͕ੜ͡Δ
Slide 8
Slide 8 text
۩ମతʹى͖ͨ ɾݪҼͷΘ͔Γਏ͍Ϋϥογϡ ɾσʔλ௨৴ྔͷ૿Ճ ɾόοςϦʔফඅͷ૿Ճ ɾͳΜ͔ͬ͞Γͯ͠Δ
Slide 9
Slide 9 text
ڞ௨ج൫νʔϜͷൃ ಛఆͷػೳʹґଘ͠ͳ͍Λվળ͠ ΞϓϦͷ࣭ΛߴΊΔ͜ͱ͕
Slide 10
Slide 10 text
RailsςοΩʔͳ ϚΠΫϩαʔϏεͷཁૉٕज़ͷ Ϛωδϝϯτͷ ΞϓϦύϑΥʔϚϯεվળͷલʹ
Slide 11
Slide 11 text
ΞϓϦύϑΥʔϚϯεͱʁ
Slide 12
Slide 12 text
ϢʔβʔମݧʹӨڹΛ༩͑Δཁૉ ɾΫϥογϡ ɾANR ɾσʔλϩʔυ ɾUI(Ξχϝʔγϣϯ) ɾόοςϦʔফඅ ɾσʔλ௨৴ྔ ΞϓϦύϑΥʔϚϯε
Slide 13
Slide 13 text
ϦϦʔεޙʹൃੜ͍͢͠ ݦࡏԽͷλΠϛϯά ϦϦʔε ςετ ʷ ύϑΥʔϚϯεѱԽ
Slide 14
Slide 14 text
ͳͥϦϦʔεޙʹൃੜ͍͢͠ͷ͔ʁ ςετͰͷ࠶ݱੑ͕͍͠ ɾຊ൪։ൃ2"ڥͷࠩҟ ɾ࣌ؒత੍Ͱػೳςετ͕ࠔ
Slide 15
Slide 15 text
ςετΑΓલͷϑϩʔͰରࡦ͢Δ ࣮࣌ʹՄೳͳݶΓࢭΊΔ ϦϦʔε ςετ ʷ ύϑΥʔϚϯεѱԽ ࣮
Slide 16
Slide 16 text
ΤϯδχΞ͕ग़དྷΔ͜ͱ ɾલఏͱͳΔࣝΛ͚ͭΔ ɾΞϯνύλʔϯΛ౿·ͳ͍࣮ ΞϓϦύϑΥʔϚϯεʹؔͯ͠
Slide 17
Slide 17 text
ຊͷτϐοΫ
Slide 18
Slide 18 text
ຊ߲͢ ɾ6*ͷվળ ɾσʔλ௨৴ྔ ɾόοςϦʔফඅ ࠶ݱੑ͕͍߲͠
Slide 19
Slide 19 text
RailsςοΩʔͳ ϚΠΫϩαʔϏεͷཁૉٕज़ͷ Ϛωδϝϯτͷ ΞϓϦύϑΥʔϚϯενϡʔχϯά࣮ફ
Slide 20
Slide 20 text
ύϑΥʔϚϯενϡʔχϯά࣮ફ 6*ͷվળ σʔλ௨৴ྔ όοςϦʔফඅ
Slide 21
Slide 21 text
ɾ6*ͷΧΫπΩ UIͷ ɾ$16 (16ʹෛ୲Λ༩͑Δॲཧ
Slide 22
Slide 22 text
ɾ6*ͷΧΫπΩ UIͷ ɾ$16 (16ʹෛ୲Λ༩͑Δॲཧ
Slide 23
Slide 23 text
ͳͥ6*ΧΫπΫͷ͔ʁ
Slide 24
Slide 24 text
'SBNF3BUF͕͍
Slide 25
Slide 25 text
ɾFPS = Frame Per Secondsɻ ɾਓؒɺ60FPS͕࠷దͱײ͡Δ Frame Rateͱ ɾ60FPS ≒ 16ms/frame ≒1ඵؒʹॲཧ͞ΕΔϑϨʔϜ(੩ࢭը໘)
Slide 26
Slide 26 text
'14ͷ࣮ݱ
Slide 27
Slide 27 text
ΞϓϦͷىಈ = Linuxϓϩηεͷىಈ શͯͷλεΫϝΠϯεϨου(UIεϨου)Ͱ࣮ߦ UI Drawing LameWork App Events UI Drawing UI Drawing Main Thread(UI Thread) PROCESS AndroidΞϓϦͷ࣮ߦϓϩηε ࢀߟ IUUQTXXXZPVUVCFDPNXBUDI W)92IVRG576MJTU1-R@V8#8R:U7*S';8S#;D#@XG98
Slide 28
Slide 28 text
NTGSBNFΛӽ͑ͯ͠·͏ →Frame͕Drop͞ΕΔ 16ms UI Drawing LameWork App Events UI Drawing UI Drawing Main Thread(UI Thread) PROCESS 16ms 16ms Drop Over 16ms 60FPSͷࣦഊ
Slide 29
Slide 29 text
ɾλεΫΛNTGSBNFʹ͑Δ 60FPSͷ࣮ݱํ๏ ɾλεΫΛࢄ͢Δ
Slide 30
Slide 30 text
ɾωοτϫʔΫॲཧ 16ms/frameΛΦʔόʔ͍͢͠λεΫ ɾ*0ॲཧ ˠϝΠϯεϨουͱผεϨουͰ࣮ߦ
Slide 31
Slide 31 text
1. εϨου(ҎޙϫʔΧʔεϨου)ͷੜ 2. ϫʔΧʔεϨου্ͰλεΫ࣮ߦ 3. ݁ՌΛϝΠϯεϨου Worker Thread Main Thread(UI Thread) Update some UI Prep some work Do some long work ϚϧνεϨοσΟϯά
Slide 32
Slide 32 text
ɾϝϞϦཧϦʔΫ ϚϧνεϨοσΟϯάͷҰൠతͳίετ ɾεϨουੜͷΦʔόʔϔου
Slide 33
Slide 33 text
εϨουΛ͍ͭੜ͠ɺഁغ͢Δ͔ඞܾͣΊΔ ɾView͔Βͷࢀর(Activity) -> LeakCanaryͷར༻ ϝϞϦཧ/ϦʔΫରԠ ɾMemory Profilerͷར༻
Slide 34
Slide 34 text
Memory Profiler 1. ώʔϓɺϝϞϦྔͷλΠϜϥΠϯ 2. ಛఆͷλΠϛϯάͰͷΞϩέʔτ͞ΕͨΦϒδΣΫτ 1 2 ࢀߟ IUUQTEFWFMPQFSBOESPJEDPNTUVEJPQSPpMFNFNPSZQSPpMFS IMKB
Slide 35
Slide 35 text
ɾCPU Profileͷར༻ εϨουੜͷΦʔόʔϔουରԠ ɾεϨουੜΦʔόʔϔουίετ͕ߴ͍ ɾεϨουࣗମΛݮΒ͢(࠷େݸCPUʹґଘ) ɾ࠶ར༻(RxJavaThreadPoolΛར༻) ࢀߟ IUUQTEFWFMPQFSBOESPJEDPNTUVEJPQSPpMFDQVQSPpMFS IMKB
Slide 36
Slide 36 text
ɾ6*ͷΧΫπΩ UIͷ ɾ$16 (16ʹෛ୲Λ༩͑Δॲཧ
Slide 37
Slide 37 text
ϨϯμϦϯά
Slide 38
Slide 38 text
ɾը໘ͷσʔλπϦʔߏ AndroidϨϯμϦϯάͷಛ ɾιϑτΣΞඳըͱϋʔυΣΞΞΫηϥϨʔγϣϯ Ҏޙ)8"
Slide 39
Slide 39 text
ɾτϥόʔαϧͳϓϩηεͷͨΊίετ͕ߴ͍ ϨϯμϦϯάͷίετ ɾ7JFXͷݺͼग़͠ ɾ͕ࢠΛଌఆ NFBTVSF 3PPU 7JFX 7JFX 7JFX 7JFX 7JFX 7JFX 7JFX ɾ࠶ؼత ɾSPPUͷαΠζ͕ܾఆ ɾը໘্ͷҐஔΛܾఆ MBZPVU ɾ༿ϊʔυͷҐஔ͕ܾఆ
Slide 40
Slide 40 text
ιϑτΣΞඳըͱHWA ɾ$16PS(16 ඳըํ๏ ιϑτΣΞඳը HWA Invalidate Canvas ผϨΠϠʔ શͯͷϊʔυʹӨڹ dirtyͷΈߋ৽
Slide 41
Slide 41 text
Πϝʔδ $BOWBT ιϑτΣΞඳը HWA →શߋ৽ →dirtyͷΈ $BOWBT ϋʔυΣΞ ϨΠϠʔ dirty
Slide 42
Slide 42 text
ɾਂ͍View֊ ɾιϑτΣΞඳըʹ͓͚ΔonDraw() ɾOverdrawingʹΑΔGPU࣌ؒͷফඅ ্࣮ͷ
Slide 43
Slide 43 text
Ұ୴πʔϧΛͬͯΈΔ
Slide 44
Slide 44 text
ɾ։ൃऀΦϓγϣϯ ɹɾGPUϨϯμϦϯάͷϓϩϑΝΠϧ࡞ ɹɾGPUΦʔόʔυϩʔΛσόοά ɹɾGPUදࣔͷߋ৽Λදࣔ ϨϯμϦϯάͷσʔλղੳπʔϧ ɾLayoutInspector
Slide 45
Slide 45 text
ɾLayoutͷώΤϥϧΩʔΛRuntimeͰղੳ͢ΔͨΊͷπʔ ϧɻxmlɺ·ͨಈతੜͨ͠ViewͳͲͷ֊ߏ͕Θ͔Β ͳ͍ࡍʹར༻͢Δɻ ɾTools -> LayoutInspector͔Β࣮ߦͰ͖Δ ɾproject_root/capturesʹRuntimeͷεφοϓγϣοτ͕อଘ͞ΕΔ LayoutInspector
Slide 46
Slide 46 text
όʔδϣϯཧ(6*࣮ߏϓϩύςΟ CaptureͷΓସ͑ Viewߏ ※) stagingڥͷͨΊdebug tool view͕දࣔ͞Ε͍ͯΔ ViewϓϩύςΟ αϯϓϧ
Slide 47
Slide 47 text
ɾGPUϨϯμϦϯάͷϓϩϑΝΠϧ࡞ ɾGPUϨϯμϦϯάͷϓϩηεຖͷίετ ɾGPUΦʔόʔυϩʔΛσόοά ɾGPUϨϯμϦϯάͷOverdraw ɾGPUදࣔͷߋ৽Λදࣔ ɾGPUϨϯμϦϯάߋ৽ॴͷಛఆ ։ൃऀΦϓγϣϯ
Slide 48
Slide 48 text
։ൃऀΦϓγϣϯ GPUϓϩϑΝΠϧ GPUΦʔόʔυϩʔ - ࢵɺԫͷΤϦΞ GPUදࣔͷߋ৽ - ͍ਖ਼ํܗ 16msϥΠϯ 1frame αϯϓϧ
Slide 49
Slide 49 text
'J/$ΞϓϦʹࢼͯ͠ΈΔ
Slide 50
Slide 50 text
'J/$ΞϓϦͷར༻ස͕ߴ͍ը໘Ͱଌఆ ɾ͍৭Overdrawճ͕4ճΛ͑Δͷɻ ɾఆظ࣮ߦΞχϝʔγϣϯ͕ΔʹɺGPU Profilerͷ ͍όʔ͕Ͷ্͕Δ ɾఆظ࣮ߦΞχϝʔγϣϯΛࢭΊͯɺͳ͔ͥඵຖʹը ໘ͷΟϯυ͕໓͠ɺΞοϓσʔτ͕ͬͯ͠·͏ɻ ɾGPU Profilerͷ੨͍όʔ͕େ͖͍ɻ ϨϯμϦϯάύϑΥʔϚϯεଌఆ
Slide 51
Slide 51 text
ύϑΥʔϚϯεͷج४Λઃஔ͢Δ ج४Λઃఆ͢Δ ɾແବͳվળΛ͠ͳ͍ͨΊ ɾఆྔత͕͚͠Εɺج४Λ࡞Δ ɾߴ࣭ΞϓϦ ɾಉػೳΞϓϦ
Slide 52
Slide 52 text
*OTUBHSBNͱͷൺֱ ՄೳͳݶΓಉ݅ ɾ͍όʔಉ͡ఔ ɾ੨͍όʔ͕શମతʹߴ͍ɻ ɾશମతʹOverdraw͕গͳ͍ɻ ɹɾView֊͕গͳ͍ ɹɾແବͳΞϧϑΝ͕ͳ͍ ɹɾదͳΫϦοϐϯάॲཧ ߴ࣭ΞϓϦͱͷൺֱ
Slide 53
Slide 53 text
ɾOverdraw RecyclerViewͷitemViewͷ༨ͳView֊ ɾGPU Profiler ɾ੨͍όʔ͕େ͖͍ = onDraw()ͷDisplayListੜͷίετɻ onDraw()ͷසɺoff-screenͷϨϯμϦϯάɺonDraw()ͷॲཧ͕ॏ͍ ɾGPUඳըͷߋ৽ ɾఆظ࣮ߦΞχϝʔγϣϯͷίετ ɹɾFiNCͪΌΜ(ΞΠίϯ) ۩ମతͳ
Slide 54
Slide 54 text
ɾෆཁͳbackgroundͷআ OverdrawͷରԠ ɾਂ͍ViewΛઙ͘͢Δ
Slide 55
Slide 55 text
Viewίϯςφʹແବͳ֊ͳ͍͔ʁ ෆཁͳbackgroundͷআ TextView FrameLayout RecyclerView
Slide 56
Slide 56 text
ɾxml্ͰແବͳViewίϯςφΛ࡞Βͳ͍ ਂ͍ViewΛઙ͘͢Δ ɾಈతʹՃ͢Δ߹ͰɺmergeΛݕ౼ ɾConstraintLayoutΛར༻͢Δ
Slide 57
Slide 57 text
վળ݁Ռ վળલ վળޙ
Slide 58
Slide 58 text
ɾPO%SBXͰͷϝϞϦΞϩέʔτېࢭ GPUϨϯμϦϯάͷରԠ ɾPO%SBXͰͷMPPQॲཧͷվળ ɾPGGTDSFFOϨϯμϦϯάͷఀࢭ
Slide 59
Slide 59 text
PO%SBXίετ͕ߴ͍ ɾෆมΦϒδΣΫτɺελοΫྖҬʹల։͢Δ Before onDrawͰͷϝϞϦΞϩέʔτېࢭ ɾGC͕ߴ͍සͰͬͯ͠·͏ After
Slide 60
Slide 60 text
MPPQͷ$BOWBTૢ࡞ίετ͕ߴ͍ ɾGPUϨϯμϦϯάGPUͷΦϒδΣΫτΛੜ͢Δ onDrawͰͷloopॲཧͷվળ ɾCanvas#drawLineͰloopͰͳ͘ɺCanvas#drawLinesΛ͏
Slide 61
Slide 61 text
PGGεΫϦʔϯ࣌ͷॲཧΛࢭΊΔ off-screenͷϨϯμϦϯάͷېࢭ ɾBVUPTMJEF͕ద༻ ɾλϒ ΧελϜ7JFX1BHFS Ҡಈ࣌ʹࢭΊΔ ɾWJTJCMF6TFS)JOU
Slide 62
Slide 62 text
ఆظ࣮ߦΞχϝʔγϣϯͷ࣮ߦ GPUඳըͷߋ৽ ˠΧελϜϏϡʔͷ)8"Λ༗ޮʹ
Slide 63
Slide 63 text
ɾ6*ͷجૅΛֶͼɺΞϯνύλʔϯΛ౿·ͳ͍ UIվળͷ·ͱΊ ɾ5PPMΛదʹ͍ɺύϑΥʔϚϯεΛվળ
Slide 64
Slide 64 text
6*ͷվળ σʔλ௨৴ྔ όοςϦʔফඅ ύϑΥʔϚϯενϡʔχϯά࣮ફ
Slide 65
Slide 65 text
Ωϟογϡͷར༻ σʔλ௨৴ྔΛݮ͢ΔͨΊʹ ωοτϫʔΫ Packet Packet Packet ը૾σʔλͷݮ ม γϦΞϥΠθʔγϣϯ
Slide 66
Slide 66 text
Ωϟογϡͷར༻
Slide 67
Slide 67 text
ϝϞϦ Ωϟογϡͱʁ σʔλͷϩʔυΛߴԽ͢ΔͨΊͷΈ σΟεΫ
Slide 68
Slide 68 text
Ϣʔεέʔεʹ߹Θͤͯ͏ σʔλอ࣋ظؒ ϝϞϦΩϟογϡ σΟεΫΩϟογϡ ࣮ߦεϨου ΞϓϦϓϩηε Πϯετʔϧத ͲͷεϨουͰྑ͍ ϫʔΧʔεϨου อଘྖҬ গͳ͍ ଟ͍ ϝϞϦ vs σΟεΫΩϟογϡ
Slide 69
Slide 69 text
ɾϝϞϦΩϟογϡ༻ͷAndroidఏڙΫϥε →༻ՄೳϝϞϦ্ݶͷνΣοΫ →্ه͔ΒLruCacheͷར༻ՄೳϝϞϦྔΛׂΓͯ ࢀߟ) https://developer.android.com/topic/performance/graphics/cache-bitmap ɾ༻ස͕͍σʔλΛআ͍ͯ͘͠ LruCacheΛ༻͍ͨϝϞϦΩϟογϡ
Slide 70
Slide 70 text
ɾσΟεΫ: ετϨʔδͷ2%ΛׂΓͯ (5MBʙ50MBͷൣғ) ࢀߟ) https://github.com/square/picasso/blob/master/picasso/src/main/java/com/squareup/picasso3/Utils.java#L163-L182 ɾsquareࣾͷը૾ϩʔυ&ΩϟογϡͷϥΠϒϥϦ ࢀߟ) https://github.com/JakeWharton/picasso2-okhttp3-downloader/blob/master/src/main/java/com/jakewharton/picasso/OkHttp3Downloader.java ɾΧελϜΩϟογϡ(Okhttp3) ɾϝϞϦ: ώʔϓྖҬͷ15%ΛׂΓͯ ࢀߟ) https://github.com/square/picasso/blob/master/picasso/src/main/java/com/squareup/picasso3/Utils.java#L184-L190 PicassoΛ༻͍ͨϝϞϦ/σΟεΫΩϟογϡ
Slide 71
Slide 71 text
Ωϟογϡೋछྨ͋ΓɺϝϞϦشൃੑɺσΟε Ϋෆشൃੑ ΩϟογϡσʔλͷΞΫηεΛߴԽ͢Δ Ωϟογϡར༻ͷ·ͱΊ →σʔλϩʔυͷͨΊͷωοτϫʔΫॲཧճ͕ݮ গ͠ɺύϑΥʔϚϯε্͕͢Δɻ
Slide 72
Slide 72 text
Ωϟογϡͷར༻ σʔλ௨৴ྔΛݮ͢ΔͨΊʹ ωοτϫʔΫ Packet Packet Packet ը૾σʔλͷݮ ม γϦΞϥΠθʔγϣϯ
Slide 73
Slide 73 text
γϦΞϥΠθʔγϣϯ
Slide 74
Slide 74 text
ྫ) ɾAPI௨৴ͰͷKotlin 㲗 JSON ɾΩϟογϡ࣌ͷϑΝΠϧॻ͖ࠐΈ ྻԽͷ͜ͱɻಛఆͷڥʹґଘͨ͠ΦϒδΣΫτ ΛόΠτྻʹม͢Δ͜ͱ γϦΞϥΠθʔγϣϯͱʁ ม
Slide 75
Slide 75 text
γϦΞϥΠθʔγϣϯͷύϑΥʔϚϯε ϝϦοτ ςΩετ(JSON, XML) όΠφϦʔܗࣜ Մಡੑ͕ߴ͍ σϝϦοτ ແବͳσʔλ͕ଟ͍ σʔλྔ͕গͳ͍ Մಡੑ͕͍ ςΩετ vs όΠφϦʔ
Slide 76
Slide 76 text
+40/ͰͷςΩετܗࣜ ɾςΩετϕʔεͷܗࣜͰσʔλྔ͕ଟ͘ͳΔ { “id”: 0, “name”: “bison”, “image”: “https://bisonworks/bisons/1/image” } ۭന Ϧλʔϯ ࢀর JSON
Slide 77
Slide 77 text
ɾprotoϑΝΠϧΛఆٛ →ίϯύΠϧ →ݴޠ͝ͱͷߏମͷੜ ɾόΠφϦܗࣜͰγϦΞϥΠζ͞ΕΔɻ ɾෳݴޠؒͰͷҰ؏ੑΛอͯΔ ɾprotoϑΝΠϧՄಡੑߴ͍ message Animal { required string name = 1; required int32 id = 2; optional string image =3; } Protocol Buffers
Slide 78
Slide 78 text
ɾςΩετܗࣜ(JSON, XML)Մಡੑߴ͍͕ɺσʔλྔଟ͍ ɾόΠφϦʔܗࣜՄಡੑ͍͕ɺσʔλྔগͳ͍ɻ ɾProtocol BuffersDSLͷΑ͏ͳͷͰɺՄಡੑ͕ߴ͘ɺ ͔ͭૹड৴࣌ͷγϦΞϥΠζ͞Εͨσʔλྔগͳ͍ γϦΞϥΠθʔγϣϯͷ·ͱΊ →Protocol BufferͰՄಡੑߴ͘ɺσʔλྔ͕গͳ͍γϦ ΞϥΠζΛߦ͏
Slide 79
Slide 79 text
Ωϟογϡͷར༻ σʔλ௨৴ྔΛݮ͢ΔͨΊʹ ωοτϫʔΫ Packet Packet Packet ը૾σʔλͷݮ ม γϦΞϥΠθʔγϣϯ
Slide 80
Slide 80 text
ը૾σʔλͷݮ
Slide 81
Slide 81 text
ը૾ϑΥʔϚοτʹؔͯ͠ ը૾ͷϑΥʔϚοτʹҙ͢Δ ɾσʔλྔ͕ஶ͘͠มΘΔ ɾը૾ͷΫΦϦςΟ͕มΘΔ
Slide 82
Slide 82 text
ը૾ϑΥʔϚοτνʔτγʔτ ࢀߟ IUUQTEFWFMPQFSBOESPJEDPNUPQJDQFSGPSNBODFOFUXPSLYGFS
Slide 83
Slide 83 text
WebPͷύϑΥʔϚϯε Մٯѹॖͷ߹ɺPNGΑΓ26%খ͍͞ ෆՄٯѹॖͷ߹ɺJPEGΑΓ25-34%খ͍͞ ࢀߟ IUUQTEFWFMPQFSTHPPHMFDPNTQFFEXFCQ
Slide 84
Slide 84 text
WebPҎ֎ͷ߹ PNG͔JPEG͔
Slide 85
Slide 85 text
PNGͱJPEG PNG JPEG ɾಁաʹରԠ ɾՄٯѹॖ ɾෆՄٯѹॖ
Slide 86
Slide 86 text
Ϣʔεέʔε PNG JPEG ɾγϯϓϧͳը૾ ɾෳࡶͳը૾ Α͘ݴΘΕΔը૾ͷ͍͚
Slide 87
Slide 87 text
γϯϓϧͳը૾ͷఆٛͱ
Slide 88
Slide 88 text
γϯϓϧͳը૾ PNG JPEG ɾෳࡶͳۂઢ͕ଘࡏ͠ͳ͍ܗ ɾ৭ͷόϦΤʔγϣϯ͕গͳ͍ ɾෳͷ৭ͷόϦΤʔγϣϯ ɾෳࡶͳۂઢ
Slide 89
Slide 89 text
ͳ͔ͥʁ
Slide 90
Slide 90 text
PNGѹॖͷΞϧΰϦζϜ(Indexed Format) RGBΛࢀর͢Δܗʹมߋ͢Δ ɾը૾ϐΫηϧ͝ͱʹRGBใΛ࣋ͭ ɾ8bit(256֊ௐ) * 3 = 24bit = 2^24 ≒ 1600ສ৭ ɾϐΫηϧ͕࣋ͭใIndexͷΈ ɾΧϥʔύϨοτΛ࣋ͭ(্ݶΛઃ͚Δ)
Slide 91
Slide 91 text
୯ҐϐΫηϧͷใྔ͕ܹݮ͢Δ ύϨοτ2,4,16,256͕ࢦఆͰ͖Δ ɾ1byteͰදݱͰ͖Δ 24bit = 3bytes 1byte
Slide 92
Slide 92 text
JPEGͷΞϧΰϦζϜ 8ϐΫηϧ͝ͱͷϒϩοΫʹ͚ͯॲཧ ϒϩοΫͰใΛϑΟϧλϦϯά͢Δ
Slide 93
Slide 93 text
ઢతͳڥքʹऑ͍ ڥք͕ΑΓઢͩͱը࣭͕ѱ͘ͳΔ 8pixel
Slide 94
Slide 94 text
ࢹνΣοΫ ਓؒͷ͍͍Ճݮ ࢹνΣοΫͰσʔλྔͷݮΛʂ
Slide 95
Slide 95 text
ը૾σʔλݮͷ·ͱΊ WebPରԠ͍ͯ͠ΕWebPͷҰ JPEGɺPNGͷσʔλྔΛཧղ͢Δɻ ͦͷ্Ͱ࣮ࡍͷͰ֬ೝͯ͠ѹॖ͢Δɻ
Slide 96
Slide 96 text
6*ͷվળ σʔλ௨৴ྔ όοςϦʔফඅ ύϑΥʔϚϯενϡʔχϯά࣮ફ
Slide 97
Slide 97 text
ɾϓϩηοα(ϋʔυ)Ͱిྲྀ͕ྲྀΕΔ ɾOS(ιϑτ)͕CPUͷϞʔυมߋΛߦ͏ → CPUϞʔυΛ͘อͭ όοςϦʔফඅΛݮ͢ΔͨΊʹ
Slide 98
Slide 98 text
$16ిྗΛޮతʹ͓͏ͱ͢Δ CPUʹϞʔυ͕͋Δ
Slide 99
Slide 99 text
࣍ͷॲཧʹඋ͑Δ,FFQ"XBLFͷίετ ϞόΠϧ௨৴࣌ͷফඅిྗ
Slide 100
Slide 100 text
ϞόΠϧ௨৴ΛࡉΕʹͨ͘͠ͳ͍
Slide 101
Slide 101 text
όονॲཧͱʁ ࢄͨ͠λεΫΛಉ࣌ʹ࣮ߦ͢Δ͜ͱɻΦʔόʔϔουΛݮগͤ͞Δɻ Task Before After Executed Task Executed Task Executed Task Task Task Executed 1 1 1 1 ϞόΠϧ௨৴࣌ͷফඅిྗ
Slide 102
Slide 102 text
αʔόʔͱͷσʔλͷಉظੑ͕ݫີͰͳ͍ͷ ࠷ѱɺσʔλ͕ࣦΘΕ͕ͯͳ͍ͷ ੳϩάσʔλ ఆظతͳσʔλͷಉظ ϞόΠϧʹ͓͚Δόονॲཧ
Slide 103
Slide 103 text
ɾJobSchedulerͱAlertManagerΛOSόʔδϣϯͰ͍͚ ɾෳλεΫͷνΣΠϯ ɾδϣϒʹ੍ݶΛ͚ͭΒΕΔ ɾόοςϦʔফඅ/ωοτϫʔΫঢ়ଶ/ॆిঢ়ଶ/CPUͷঢ়ଶ/ετϨʔδͷۭ͖ ɾԆͰ͖Δ(Deferrable)ఆظత/ϫϯλΠϜͳδϣϒʹ͏ WorkManager ɾόοΫΦϑ(ࢦؔతස)αϙʔτ
Slide 104
Slide 104 text
ϘτϧωοΫΛ୳Γ͍ͨ
Slide 105
Slide 105 text
#BUUFSZ)JTUPSJBO ͷόοςϦʔফඅྔΛՄࢹԽग़དྷΔπʔϧ 1. OverViewͷάϥϑ ɾ߲ΛϐοΫͨ͠ΧελϜάϥϑͰ͖Δ 2. App Selection ɾΞϓϦ/߲ͰϑΟϧλՄೳ 3. Tables ɾΞϓϦؒൺֱ/ώετϦʔ(ྦྷੵσʔλ)/ΞϓϦελοπ 4. ݁Ռ ɾϑΟϧλ݁ՌΛදࣔ͢Δ σʔλղੳπʔϧ
Slide 106
Slide 106 text
ɾͷిফඅྔΛՄࢹԽग़དྷΔπʔϧ ɾDocker্Ͱಈ͘(Α͏ʹͳͬͯΔʂ) 1. OverViewͷάϥϑ 2. App Selection 3. Tables 4. ݁Ռ Battery Historianͷશମతͳߏ
Slide 107
Slide 107 text
ɾެࣜ: https://github.com/google/battery-historian EPDLFSSVOQQPSUHDSJPBOESPJECBUUFSZIJTUPSJBOTUBCMFQPSU ɾԿͰΑ͍ɻ9999ͱ͔ʹ͓ͯ͘͠ IUUQMPDBMIPTUQPSU ɾAndroidʹbugreportsͷdir͕͋Δ adb bugreport bugreport.zip ※) ެࣜͷͰΤϥʔ͕ग़Δਓී௨ʹabdͰϑΝΠϧసૹ͍ͯͩ͘͠͞ɻ ڥߏங
Slide 108
Slide 108 text
Battery Level1ࠁΈͳͷͰɺ͍෦͕ফඅిྗ͕ߴ͍෦ όοςϦʔͷղੳํ๏
Slide 109
Slide 109 text
CPUͷϞʔυ ϞόΠϧ௨৴ίετ͕ߴ͍ όοςϦʔͷղੳํ๏
Slide 110
Slide 110 text
ܧଓతଌఆ͕͍͠
Slide 111
Slide 111 text
ܦݧ্ɺٙͬͯΈΔͱྑͦ͞͏ͳ͜ͱ όοΫάϥϯυͰఆظతͳॲཧΛ࣮ߦ͍ͯ͠Δ ը໘্Ͱଟ͘ͷωοτϫʔΫॲཧΛߦ͍ͬͯΔλεΫ ఆੑతʹΞϓϩʔν͢Δ ɾසɺॏ͍ॲཧ ɾෆదͳϥΠϑαΠΫϧ(onResumeͳͲ)Ͱͷίʔϧ
Slide 112
Slide 112 text
CPUͷϞʔυ(awake, sleep)ΛSleep ϞόΠϧ௨৴ԆΛݕ౼͢Δ ఆྔͱఆੑతͳ྆໘͔ΒΞϓϩʔν͢Δ όοςϦʔফඅͷ࠷దԽ·ͱΊ
Slide 113
Slide 113 text
RailsςοΩʔͳ ϚΠΫϩαʔϏεͷཁૉٕज़ͷ Ϛωδϝϯτͷ શମతͳ·ͱΊ
Slide 114
Slide 114 text
શମతͳ·ͱΊ ࠶ݱੑ͕͍ύϑΥʔϚϯεʹରॲ͢Δ ύϑΥʔϚϯεͷલఏࣝΛ͚ͭɺఆੑͱఆྔͱͷ ྆ྠ͔ΒΞϓϩʔν͍ͯ͘͠