Commit 388e25f
利用Trie结构将性能提升了10倍
借助新的并行计算工具构造了一个Trie结构,在保持APK Parser性能基本不变的情况下,将
自动适配表达式的性能提升了10倍。原先一个表达式求值需要耗费将近1秒,现在只需20ms不到。
旧的Benchmark记录
BM: Parse DexClasses takes 758 ms.
BM: Search android.support.v4.app takes 747 ms.
BM: Search com.tencent.mm.ui.contact takes 1239 ms.
BM: Search com.tencent.mm.plugin.sns.ui takes 1393 ms.
BM: Search com.tencent.mm takes 1635 ms.
BM: Search com.tencent.mm.ui.conversation takes 761 ms.
BM: Search com.tencent.mm.sdk.platformtools takes 860 ms.
BM: Search com.tencent.mm.sdk.platformtools takes 669 ms.
BM: Search com.tencent.mm.booter.notification takes 561 ms.
BM: Search com.tencent.mm.storage takes 871 ms.
BM: Search com.tencent.mm.booter.notification.queue takes 913 ms.
BM: Search com.tencent.mm.ui takes 518 ms.
BM: Search com.tencent.mm.modelsfs takes 626 ms.
BM: Search com.tencent.mm.ui.chatting takes 470 ms.
BM: Search over classes takes 4414 ms.
数据结构升级后的Benchmark记录
BM: Parse DexClasses takes 779 ms.
BM: Search android.support.v4.app takes 42 ms.
BM: Search com.tencent.mm takes 167 ms.
BM: Search com.tencent.mm.sdk.platformtools takes 5 ms.
BM: Search com.tencent.mm.booter.notification takes 1 ms.
BM: Search com.tencent.mm.booter.notification.queue takes 0 ms.
BM: Search com.tencent.mm.modelsfs takes 0 ms.
BM: Search com.tencent.mm.plugin.sns.ui takes 66 ms.
BM: Search com.tencent.mm.storage takes 1 ms.
BM: Search com.tencent.mm.ui takes 2 ms.
BM: Search com.tencent.mm.ui.chatting takes 24 ms.
BM: Search com.tencent.mm.ui.contact takes 19 ms.
BM: Search com.tencent.mm.ui.conversation takes 14 ms.
BM: Search over classes takes 558 ms.1 parent 7fcb0d7 commit 388e25f
File tree
5 files changed
+105
-36
lines changed- src/main/kotlin/com/gh0u1l5/wechatmagician/spellbook
- parser
- util
5 files changed
+105
-36
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
Lines changed: 23 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
33 | 49 | | |
34 | 50 | | |
35 | 51 | | |
| |||
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | | - | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
Lines changed: 7 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 81 | + | |
| 82 | + | |
100 | 83 | | |
101 | | - | |
102 | | - | |
| 84 | + | |
103 | 85 | | |
104 | 86 | | |
105 | 87 | | |
| |||
0 commit comments