一、測試用例
1、500 names
-
Case1
- 使用姓名1個:邊吳麗
- Query:剛才邊無力還來過
- Length:8
-
Case2
- 使用姓名5個:趙飛耀,連云玲,龍小紅,米夏夏, 趙穎虹
- Query:趙飛要、連蕓玲跟龍曉洪和米嚇嚇以及趙英洪是好朋友
- Length:24
-
Case3
- 使用姓名10個:堵文斌,黃登清,龍嵐珺,穆高超,齊文海,龔尚福,趙馨惠,阿不都克里木,黃生高,邊凌飛
- Query:堵問斌,黃燈青,隆嵐珺,穆膏抄,齊溫海,龔上福,趙心會,阿不都客李木,黃聲膏,邊令飛好開心啊好開心
- Length:49
2、1000 names
-
Case4
- 使用姓名10個:車序南,龍岳紅,黃盈瑞,齊昌玉,龍小霞,龔小雪,齊春玲,米增渝,齊曉海,籍尹超
- Query:車序男,榮岳紅,黃瑩瑞,齊昌欲,龍驍霞,龔小血,齊椿玲,米增魚,齊小海,籍尹炒
- Length:39
-
Case5
- 使用姓名20個:齊方明,趙音頻,黃皛夢,章衣萍,連書琦,黃生雄,趙韻韻,齊明山,齊文泉,樊成飛,邊劍英,黃益慧,龔巖棟,龔峰彪,黃皖林,趙馨惠,邊冬霞,齊景偉,賀黎黎,龍小純,邊召允
- Query:齊方名,趙因貧,黃皛孟,章一萍,連叔琦,黃升雄,趙韻孕,齊明刪,齊聞全,樊程非都很不錯的樣子。邊鍵英,黃易慧,龔嚴棟,龔峰標,黃晚林,趙鑫惠,邊冬霞,齊井偉,賀離黎,龍曉純,邊趙允
- Length:90
-
Case6
- 使用姓名25個:米士奇,齊曉兵,龔岳明,邊葉兵,龔家萍,邊向東,趙穎茹,賈鶴鳴,辛均安,符勝斌,龔峻峰,樊成飛,黃盱寧,趙穎莉,黎玉龍,龍小素,龍安邦,齊文波,趙穎鶯,趙穎瑩,黃盛慰,龍學鋒,黃目張,賈鶴鵬,黃甲鋒,竇連玉
- Query:堵問斌,黃燈青,隆嵐珺,穆膏抄,齊溫海,龔上福,趙心會,阿不都客李木,黃聲膏,邊令飛好開心啊好開心
- Length:82
3、5000 names
-
Case7
- 使用姓名10個:黃甫新,樊明灝,黃瓊芝,黃琳蓮,黃琴莉,車帝麟,樊文勝,樊曉棟,黃瓊藝,黃瓊英,龍定建
- Query:黃甫心樊銘灝黃瓊只黃琳連黃琴莉,車地麟樊文剩和樊曉洞黃瓊易黃瓊鸚以及龍定建都是人名。
- Length:42
-
Case8
- 使用姓名20個:龔宗宜,黃玉穎,樊曉桃,龍家安,黃琦薇,樊曉椏,竇越超,黃玉順,黃瑞紅,黃珠連,黎瓊強,樊晶明,樊昀瑛,車廣錦,龍小勇,樊文英,龔小京,龔小亮,樊文苓,龔子方
- Query:龔宗一黃玉影子列傳樊曉淘氣龍家案子,黃琦危險急了,樊小椏竇越抄寫生字詞,黃玉舜間成為永恒,黃銳紅黃豬連黎穹強樊經明樊昀鸚,車光僅龍小永遠,樊文嚶嚶嚶,龔小京龔肖亮樊聞苓龔籽方
- Length:87
-
Case9
- 使用姓名50個:樊晴月,符紅羽,黃玖香,龍小博,黃申林,趙魯強,趙驥飛,黃玉魁,黃玲霞,黃疆平,龔定康,龔將軍,黃現青,梅鈺芳,樊明琴,黎獻騰,趙魯建,樊本軍,龍尚勇,龍小同,黃珂銘,龔子來,龔小倩,樊未軍,黃玲雄,黃玲雅,龔家富,黃玉鮮,樊春燕,黃瑞苑,樊景棠,龔學文,車慶隴,黃生武,黃瑞芬,龔寶康,黃瑞花,樊明瑞,黃瑤群,龔子柱,黃玲青,黃理賢,龔家安,黃瑜芳,龍少君,車忠民,樊新萍,連加增,章虹雨,龍子翔
- Query:樊晴越符洪羽黃酒香龍曉博,黃身林趙陸墻,趙冀非黃欲逵,黃零霞黃姜平,功定康龔僵軍,黃現清梅玉芳樊名琴黎線騰,趙鹵建樊苯軍龍上勇龍曉彤,黃科銘龔籽來龔肖倩范未軍黃零雄黃凌雅龔家富黃玉仙樊椿艷黃瑞愿樊井棠龔穴文車頃隴黃聲武、黃銳芬龔保糠、黃瑞華樊銘瑞黃姚群龔紫柱黃玲輕黃里賢龔佳安黃余芳龍邵君車中民、樊心萍連家增章洪雨龍紫翔
- Length:160
二、測試數據
1、iPhone4S _ iOS9.3.5
初始化Demo Memory:5.2M
- ReadPlist Memory
500names | 1000names | 5000names |
---|---|---|
5.2 | 5.2 | 5.3 |
4sReadMemory.png
- ConvertString
CostTime:ms
case1 | case2 | case3 | case4 | case5 | case6 | case7 | case8 | case9 |
---|---|---|---|---|---|---|---|---|
122 | 132 | 126 | 159 | 168 | 194 | 513 | 523 | 576 |
4sConvert.png
ConvertMemory:MB
case1 | case2 | case3 | case4 | case5 | case6 | case7 | case8 | case9 |
---|---|---|---|---|---|---|---|---|
5.6 | 5.8 | 5.9 | 6.0 | 6.2 | 6.1 | 6.6 | 6.7 | 6.8 |
4s-memory.png
2、iPhone5 _ iOS10.1.1
初始化Demo Memory:5.5M
- ReadPlist Memory
500names | 1000names | 5000names |
---|---|---|
5.5 | 5.5 | 5.7 |
iphone5ReadPlistMemory.png
- ConvertString
CostTime:ms
case1 | case2 | case3 | case4 | case5 | case6 | case7 | case8 | case9 |
---|---|---|---|---|---|---|---|---|
92.07 | 92.088 | 90.401 | 114.373 | 122.075 | 147.194 | 364.251 | 374.675 | 415.785 |
iphone5_convertcostTime.png
ConvertMemory:MB
case1 | case2 | case3 | case4 | case5 | case6 | case7 | case8 | case9 |
---|---|---|---|---|---|---|---|---|
6.0 | 6.2 | 6.3 | 6.3 | 6.4 | 6.5 | 7.0 | 7.1 | 7.3 |
i5-memory.png
3、iPhone6 _ iOS10.3.3
初始化Demo Memory:8.3M
- ReadPlist
500names | 1000names | 5000names |
---|---|---|
8.7 | 10.0 | 12.7 |
iphone6_ReadMemory.png
- ConvertString
CostTime:ms
case1 | case2 | case3 | case4 | case5 | case6 | case7 | case8 | case9 |
---|---|---|---|---|---|---|---|---|
143.397 | 171.712 | 156.479 | 216.99 | 234.31 | 248.918 | 541.992 | 540.683 | 586.524 |
i6_convertTime.png
ConvertMemory:MB
case1 | case2 | case3 | case4 | case5 | case6 | case7 | case8 | case9 |
---|---|---|---|---|---|---|---|---|
8.9 | 10.5 | 10.1 | 12.9 | 9.4 | 9.3 | 13.8 | 13.9 | 12.2 |
i6-memory.png
4、其他數據
- 不同機型ReadPlist時間:ms
iPhone4S
500names | 1000names | 5000names |
---|---|---|
9.0 | 11 | 24 |
iPhone5
500names | 1000names | 5000names |
---|---|---|
7.207 | 9.722 | 20.666 |
iPhone6
500names | 1000names | 5000names |
---|---|---|
2.187 | 3.5 | 8.314 |
readPlist.png
三、暫時結論
- 查詢所花費的時間
- 待查詢字符串的長度的對數 正相關
- 通訊錄名字個數 正相關
- 查詢所花費內存
- 待查詢字符串的長度的對數 正相關
- 通訊錄名字個數 正相關
- Plist姓名資料在iOS端不同機型上均有較快的讀取速度
- Mark : 二輪測試,數值較穩定