iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

Posted 娴嬭瘯鍏堥攱

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS鎬ц兘娴嬭瘯瀹炴垬-instruments相关的知识,希望对你有一定的参考价值。


鐐瑰嚮 钃濆瓧 馃憜鍏虫敞銆?/span> 娴嬭瘯鍏堥攱 銆戯紝涓嶅啀杩疯矾锛?/span>
涓€璧锋垚涓轰簰鑱旂綉娴嬭瘯绮捐嫳锛屽墠鐬绘祴璇曟妧鏈綖



瀵艰iOS 鎬ц兘娴嬭瘯鍏ラ棬绡囷紝iOS 鎬ц兘娴嬭瘯濡傛灉瑕佸仛鐨勬洿娣卞叆锛屽彧鐭ラ亾浣跨敤 instruments 鎴栬€呭叾浠栫殑涓€浜涘紑婧愬伐鍏凤紙濡?wetest 鐨?perfdog 锛夋槸涓嶅鐨勶紝杩橀渶瑕佽嚜宸辨牴鎹渶姹傚畾鍒?iOS 娴嬭瘯宸ュ叿銆傝繖閲岀瓑閬囧埌鍏蜂綋闇€姹備簡鍐嶅啓銆備粖澶╄繖绡囧氨璋堜竴璋堟垜瀵?iOS 鎬ц兘娴嬭瘯鐨勭悊瑙o紝涔熸槸澶嶄範涓€涓嬩箣鍓嶆帉鎻$殑鐭ヨ瘑銆?/span>

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments    涓婄瘒鍥炵湅 馃憠 锛?nbsp; 

    iOS鎬ц兘娴嬭瘯瀹炴垬-instruments1/  鐩墠 ios 鎬ц兘娴嬭瘯鐜扮姸

璁蹭釜鏁呬簨涓哄紩:涓€涓伐鍘?鏈?0鏉℃祦姘寸嚎,鏈変竴娆¤€佹澘鍘婚棶涓€涓伐浜?浣犺繖鏉℃祦姘寸嚎鐨勬垚鍝佺巼澶氬皯,宸ヤ汉璇?8%,鑰佹澘鎽囦簡鎽囧ご,璧颁簡銆傚悗鏉ュ伐浜洪棶涓荤鑰佹澘涓轰綍璧颁簡锛屼富绠¤锛氣€滄瘡鏉$敓浜х嚎閮芥槸98%锛岄偅50鏉℃祦姘寸嚎灏辨槸98%涔?0娆★紝鍩烘湰涓婂氨鏄?0%澶氾紝杩欑鎴愬搧鐜囧宸ュ巶鐢熷瓨閮芥槸涓寫鎴樹簡銆傗€濈敱杩欎釜鏁呬簨鎴戜滑鍙互鐭ラ亾锛屽叾瀹炴湁鐨勬椂鍊欒兘浜夊彇涓€鐐瑰氨浜夊彇涓€鐐癸紝鍦ㄦ€ц兘娴嬭瘯褰撲腑鏄涔堢殑閲嶈銆傜洰鍓峣OS鎬ц兘娴嬭瘯涓昏鏈変袱閮ㄥ垎鏉ヤ紭鍖栵細
a.浠g爜灞傞潰 reivew浼樺寲
b.閫氳繃涓€浜涙€ц兘宸ュ叿鏉ュ府鍔╂寲鎺橀」鐩摱棰?br class="mq-32">鏈枃涓昏灏辨€ц兘宸ュ叿鐨勫眰闈㈡潵闃愯堪鎬ц兘娴嬭瘯鐨勪竴浜涙妧宸у拰蹇呭鐭ヨ瘑銆?/span>

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

2/  Instruments 鐨勪紭鍔?/span>

Instruments 鏄?Xcode 鐨勪竴涓伐鍏烽泦锛屼负鎴戜滑鎻愪緵浜嗗己澶х殑绋嬪簭鎬ц兘鍒嗘瀽鍙婃祴璇曡兘鍔涖€俋code鏄?/span>缂栬瘧iOS椤?/span>鐩椂鐢ㄧ殑缂栬瘧鍣紝鎵€浠ヨ繖閲岀殑鍏煎鎬ч棶棰樻槸涓嶇敤鑰冭檻鐨勶紝鑰屼笖Instruments鏄湁鎸佺画缁存姢鍜屾洿鏂扮殑瀹樻柟宸ュ叿銆傝繖灏卞ソ鍍忓緢灏戝惉璇磇OS椤圭洰涓嶇敤Xcode缂栬瘧鍣ㄤ竴鏍凤紝宸ュ叿绔湪iOS渚у叾瀹炴病鏈夐偅涔堝鐨勯€夋嫨銆傝鑰呬篃涓嶅繀绾犵粨涓€浜涘叾浠栧伐鍏凤紝鍥犱负涓嬮潰鐨勪粙缁嶅彲浠ヨ浣犵煡閬搃OS鐨処nstruments宸茬粡瓒冲寮哄ぇ銆?/span>

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

3/  Instruments 甯哥敤鍔熻兘浠嬬粛

杩炴帴MAC 鐢佃剳锛屾墦寮€ instruments 灞曠ず濡備笅鐣岄潰锛?/span>

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

瀵瑰簲涓婂浘鐨勮嫳鏂囧叿浣撹В閲婂姛鑳藉涓嬶細

鍔熻兘 鍏蜂綋瑙i噴
Blank 鍒涘缓涓€涓┖鐨勬ā鏉匡紝浣犲彲浠ヨ嚜瀹氫箟鐨勬坊鍔犲悇绉嶅伐鍏?/span>
Activity Monitor 鍙互鍙敤杩欎釜妯℃澘锛岀爺绌剁郴缁熷伐浣滆礋杞藉拰铏氭嫙鍐呭瓨澶у皬鐨勫叧绯?/span>
Allocations 灏咥llocations鍜孷M璺熻釜鍣ㄥ姞鍒拌窡韪枃妗d腑锛屼娇鐢ㄨ宸ュ叿鍙互鐩戣鍐呭瓨鍜屽璞$殑鍐呭瓨鍒嗛厤鏂瑰紡鍜屾儏鍐?/span>
CocoaLayout 鏄竴绉岰ocoa甯冨眬宸ュ叿 锛屽彲浠ュ簲鐢ㄤ簬iOS妯℃嫙鍣ㄥ拰Cocoa妗岄潰搴旂敤锛屼絾鏄笉鑳藉拰杩炴帴鐨刬OS璁惧涓€璧蜂娇鐢ㄣ€傝瀵烴SLayoutConstraint瀵硅薄鐨勬敼鍙橈紝甯姪鎴戜滑鍒ゆ柇浠€涔堟椂闂翠粈涔堝湴鐐圭殑constraint鏄惁鍚堢悊
Core Animation 灏咰oreAnimation鍔犲叆鍒拌窡韪枃妗d腑锛屽彲浠ユ祴閲廼os璁惧涓婃瘡绉掔殑CoreAnimation甯ф暟锛岃繖鍙互甯姪浣犵悊瑙e唴瀹规槸濡備綍娓叉煋鍒板睆骞曚笂鐨勶紝锛堝浘褰㈡€ц兘锛夎繖涓ā鍧楁樉绀虹▼搴忔樉鍗℃€ц兘浠ュ強CPU浣跨敤鎯呭喌銆?/span>
CoreData 灏咰oreData鏁版嵁鎻愬彇銆佺紦瀛樼己澶卞拰瀛樺偍鍔犲叆鍒拌窡韪枃妗d腑锛屼娇鐢ㄨ繖涓伐鍏峰彲浠ユ娴嬪簲鐢ㄧ▼搴忎腑鏁版嵁鐨勫瓨鍌ㄤ氦浜?/span>
Counters 鏀堕泦浣跨敤鏃堕棿鎴栧熀浜庝簨浠剁殑鎶芥牱鏂规硶鐨勬€ц兘鐩戞帶璁℃暟鍣紙PMC锛変簨浠躲€?/span>
Energy Log 鑰楃數閲忕洃鎺э紝灏咵nergy Diagnostics, CPU Activity, Display Brightness, Sleep/Wake, Bluetooth, WiFi, and GPS instruments鍔犲叆鍒拌窡韪枃妗d腑杩涜妫€娴嬨€?/span>
File Activity 灏咶ile Activity, Reads/Writes, File Attributes, and Directory I/O instruments 鍔犲叆鍒拌窡韪枃妗d腑锛屽彧鐢ㄨ繖涓ā鏉垮彲浠ヨ浣犳鏌ョ郴缁熸枃浠剁殑浣跨敤鎯呭喌锛屽彲浠ユ鏌ユ枃浠剁殑鎵撳紑銆佸叧闂€佽鍜屽啓鎿嶄綔锛屽悓鏃朵篃鍙互妫€娴嬫枃浠剁郴缁熸湰韬殑鏀瑰彉锛屽寘鎷潈闄愬拰鎵€鏈夋潈鍙戠敓鐨勬敼鍙樸€?/span>
Leaks 灏唗he Allocations and Leaks instruments鍔犲叆鍒版ā鏉夸腑锛屼娇鐢ㄨ繖涓ā鏉垮彲浠ュ府鍔╀綘妫€娴嬪唴瀛樼殑娉勬紡銆?/span>
Metal System Trace 瀹冩槸鏄痑pple 2014骞村湪ios骞冲彴涓婃帹鍑虹殑楂樻晥搴曞眰鐨?D鍥惧舰API锛屽畠閫氳繃鍑忓皯椹卞姩灞傜殑API璋冪敤CPU鐨勬秷鑰楁彁楂樻覆鏌撴晥鐜囥€?/span>
Network 鐢ㄩ摼鎺ュ伐鍏峰垎鏋愪綘鐨勭▼搴忓浣曚娇鐢═CP/IP鍜孶DP/IP閾炬帴銆?/span>
OpenGL ES Analysis 灏哋penGL ES Analyzer and OpenGL ES Driver鍔犲叆鍒版ā鏉夸腑锛岃繖涓ā鍧楁祴閲忓垎鏋怬penGL ES娲诲姩姝g‘鎬ф娴嬩互鍙婅〃鐜伴棶棰橈紝鎻愪緵瑙e喅寤鸿銆?/span>
System Trace 绯荤粺璺熻釜锛岄€氳繃鏄剧ず褰撳墠琚皟搴︾嚎绋嬫彁渚涚患鍚堢殑绯荤粺琛ㄧ幇锛屾樉绀轰粠鐢ㄦ埛鍒扮郴缁熺殑杞崲浠g爜閫氳繃涓や釜绯荤粺璋冪敤鎴栧唴瀛樻搷浣溿€?/span>
System Usage 杩欎釜妯℃澘璁板綍鍏充簬鏂囦欢璇诲啓锛宻ockets锛孖/O绯荤粺娲诲姩锛?杈撳叆杈撳嚭銆?/span>
Time Profile 鎵ц瀵圭郴缁熺殑CPU涓婅繍琛岀殑杩涚▼浣庤礋杞芥椂闂翠负鍩虹閲囨牱銆?/span>
Zombies 娴嬮噺涓€鑸殑鍐呭瓨浣跨敤锛屼笓娉ㄤ簬妫€娴嬭繃搴﹂噴鏀剧殑閲庢寚閽堝璞★紝涔熸彁渚涘璞″垎閰嶇粺璁★紝浠ュ強涓诲姩鍒嗛厤鐨勫唴瀛樺湴鍧€鍘嗗彶銆?/span>

杩欓噷甯哥敤宸ュ叿涓昏鏈夛細Activity Monitor, Allocations,Core Animation,Leaks 鍦ㄤ笅涓€鑺傚綋涓篃閲嶇偣浠嬬粛涓嬫槸鍦ㄩ」鐩腑濡備綍浣跨敤Instruments鐨勮繖鍑犱釜鍔熻兘鍙戠幇闂鐨勩€?nbsp; 

4/  Instruments 瀹炴垬鎿嶄綔涓句緥锛堜笂锛?/span>

浠ヤ竴涓?app鎬ц兘闇€姹傛祴璇?nbsp;涓轰緥锛屼互涓嬬畝绉?APP 灏廇锛屼粙缁嶅嚑涓叧浜庨煶瑙嗛鐩稿叧鐨勬€ц兘娴嬭瘯 case銆?/span>

  锛?锛変笟鍔¤棰戝悎鎴愰〉闈?甯ч€?FPS 娴嬭瘯

- 闇€姹傦細閽堝 APP 灏?A 缂栬緫瑙嗛鐨勯〉闈㈠抚鐜囪繘琛屼笓椤规祴璇曪紝閫氳繃鎻愰珮棰勮鏃剁殑 FPS锛屾潵鎻愰珮鐢ㄦ埛鍒朵綔鐨勬鏈?br>

 - 鍏蜂綋浣跨敤鍒扮殑宸ュ叿锛氶€傜敤instruments 鐨?core animation 鏉ユ祴璇?FPS

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

锛?锛夊叿浣撴搷浣?/span>

鍏蜂綋鎿嶄綔鐨勯〉闈細

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

鍙互鐪嬪埌锛屽浘涓晫闈笅鏂规槸鏈?fps 婊氬姩鐨勩€傛寜鐓ц繖涓柟娉曟祴璇曞嚑娆炬満鍨嬶紝鎷垮埌璇︾粏鐨勬暟鎹粨鏋溿€?/span>

娉ㄦ剰锛氬湪鍋氭€ц兘娴嬭瘯鐨勬椂鍊欙紝瑕佷粠鍔熻兘娴嬭瘯鐨勮搴︽潵鍒嗘瀽銆傚嵆涓氬姟渚э細

闂 1锛氱敤鎴锋粦鍔ㄧ殑鏃跺€欐槸鎬庝箞婊戠殑锛燂紙蹇€熷埛锛屾參鍒凤級

闂2锛氱敤鎴锋粦鍔ㄧ殑鏃跺€欙紝鐪嬪埌鐨勬槸瑙嗛锛岃繕鏄浘锛燂紙feed鍔犺浇涓嶅悓鍐呭鐨勬椂鍊欐€ц兘鍙樺寲锛?br>闂3锛氬揩閫熸粦鍔ㄧ殑鏃跺€欐暟鎹姞杞介棶棰橈紝鏄惁鏈変紭鍖栫┖闂达紵

鏍规嵁涓婅堪3涓棶棰橈紝鍐嶆牴鎹叿浣撴搷浣滄潵閫愪釜鑾峰緱鏁版嵁锛屾渶鍚庡彂鐜颁笌绔炲搧鐨勬暟鎹姣斿涓嬶細

锛?锛夋祴璇曠粨璁轰笌鍘熷洜鍒嗘瀽

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

涓嬮潰缁欏嚑涓€ц兘娴嬭瘯鐨勭粨璁烘牱渚嬶紝鏂逛究鍚勪綅鍚屽鍙傝€冿細

锛坅锛夌珵鍝佸姣旂粨璁猴紙鏍蜂緥锛?/span>

蹇€熸粦鍔ㄧ殑鏃跺€欙紝绔炲搧甯х巼闈炲父绋冲畾鐨勫師鍥犳湁濡備笅鍑犱釜锛?br>

 - 瀵逛簬蹇€熺殑 UIKit 鏈変紭鍖栫┖闂达紝寮傛鐨勫姩浣滀笌涓昏繘绋嬪垎寮€锛屼繚璇佷富杩涚▼鐨勬€ц兘銆?/span>

 - 鍒嗛〉閫昏緫闇€瑕佹洿鍔犵粏鑵伙紝鍦ㄥ垎椤垫暟鎹笉澶熸椂锛屽鍔犵紦鍐叉潯 UI锛屼笉璁╃敤鎴蜂笉鍋滅殑鍚戜笅婊?/span>

瀵逛簬鎱㈡粦鏃跺抚鐜囪繃楂樼殑鍘熷洜鍒嗘瀽锛?br>

鎱㈡粦鐨勬椂鍊欎竴鐩磋兘淇濇寔楂?FPS 鐨勫師鍥犲彲鑳芥槸鍥犱负鍦ㄢ€滄寔缁挱鏀捐棰戔€濓紝瑙嗛鐨勫抚鐜囧彲浠ヤ繚鎸佸湪 60FPS 涓嶆帀锛屾墍浠ヨ feed 鐨勫抚鐜囦篃浼氫繚鎸佸湪 60FPS 涓嶆帀銆備絾鏄珵鍝佺殑 feeds 娌℃湁鎾斁閫昏緫锛屾墍浠ヨ妭绾︿簡杩欏潡鐨勬€ц兘鏀嚭銆傚睍绀虹殑鍐呭灏戯紝灏辩畻甯х巼浣庯紝鎱㈡粦鐨勬椂鍊欐劅瀹樹綋楠屼篃涓嶄細澶樊銆備絾鏄湪蹇€熸粦鍔ㄧ殑鏃跺€欙紝APP-A 灏辫兘鏄庢樉鎰熷彈鍒板崱椤?br>

锛坆锛夊鏈哄瀷娴嬭瘯璇︾粏缁撹锛堟牱渚嬶級锛?/span>

iPhone6 锛?/span>

鍙互鐪嬪埌鏈夊緢澶氫綆浜?0fps鐨勫抚鐜囪〃鐜?杩欎簺鏃跺埢鍩烘湰涓婇兘鏄痵eek锛屽湪fps涓?鐨勭壒娈婃椂鍊欙紝鍙互鐪嬪埌褰撴椂cpu鐨勭洃鎺?cpu骞舵病鏈夎窇鍒板嘲鍊硷紝鍥犳杩欓噷鍙兘鏈変紭鍖栫殑绌洪棿

iPhone7P锛?/span>

iPhone7p鍦╯eek鐨勬椂鍊欐暟鎹〃鐜拌緝濂斤紝灏ゅ叾鍦ㄩ绻乻eek锛屽垏鎹富棰樼殑鏃跺€欏彲浠ョ湅鍒板抚鐜囧苟娌℃湁鎺夌殑寰堝帀瀹筹紝cpu鐨勫埄鐢ㄧ巼涔熸病鏈夊埌杈惧嘲鍊?/span>

iPhoneX锛?/span>

iPhoneX鏈哄瀷鍦╯eek 鍒囨崲涓婚锛屾甯搁瑙堟挱鏀剧殑鏃跺€檉ps閮借〃鐜颁紭寮傦紝娌℃湁鍑虹幇鎺夊抚锛屼篃娌℃湁鍑虹幇fps浣庝簬30鐨勬儏鍐?/span>

    鑷虫锛屽熀浜?iOS 鎬ц兘娴嬭瘯鐨?FPS 甯х巼娴嬭瘯鐨勫満鏅氨鍩烘湰涓婃祴璇曞畬浜嗭紝鎴戣寰楀伐鍏峰叾瀹炴槸娆¤鐨勶紝涓昏杩樻槸鍦ㄥ仛鎬ц兘娴嬭瘯鐨勬椂鍊欑殑鎬濊€冨拰鐚滄兂楠岃瘉姣旇緝閲嶈銆傚钩鏃惰澶氶敾鐐艰繖鏂归潰鐨勮兘鍔涳紝鎵嶈兘蹇€熷府蹇欏畾浣嶄笟鍔¢棶棰樸€?/span>




寰€鏈熸枃绔犳帹鑽愶細


馃憠  

馃憠   

馃憠  

馃憠  

 iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

iOS鎬ц兘娴嬭瘯瀹炴垬-instruments

濡傛灉鎮ㄥ枩娆紝鑳界偣涓€滃湪鐪嬧€濆悧锛熸偍鐨勨€滃湪鐪嬧€濇槸鎴戞渶澶х殑鍔ㄥ姏锛屾劅璋㈡偍锛?/p>

娴嬭瘯鍏堥攱锛氱Н璺锛岃嚦鍗冮噷锛屽仛韪忚笍瀹炲疄鎶€鏈汉鉁岋笍




以上是关于iOS鎬ц兘娴嬭瘯瀹炴垬-instruments的主要内容,如果未能解决你的问题,请参考以下文章

linux绯荤粺IO鎬ц兘娴嬭瘯

鎬ц兘娴嬭瘯涔嬫柊涓€浠f湇鍔″櫒鎬ц兘娴嬭瘯宸ュ叿Gatling

鎬ц兘娴嬭瘯鐢ㄤ緥璁捐

涓嬪懆涓夛綔鏈嶅姟绔郴缁熸€ц兘娴嬭瘯

銆愮洿鎾€戞暣杞﹂┚涔樻€ц兘娴嬭瘯璇勪环瑙e喅鏂规