Commit 6bf75e7
committed
[llvm][mustache] Use BumpPtrAllocator to save ASTNodes
We make the Mustache ASTNodes usable in the arena by first removing all
of the memory owning data structures, like std::vector, std::unique_ptr,
and SmallVector. We use standard LLVM list types to hold this data
instead, and make use of a UniqueStringSaver to hold the various
templates strings.
Additionally, update clang-doc APIs to use the new interfaces.
Future work can make better use of Twine interfaces to help avoid any
intermediate copies or allocations.
| Benchmark | Baseline (ns) | Arena (ns) | Change |
| :--- | :--- | :--- | :--- |
| `StringRendering/Escaped` | 12,883,958 | 12,938,218 | +0.42% |
| `StringRendering/Unescaped_Triple` | 68,050 | 66,989 | -1.56% |
| `StringRendering/Unescaped_Ampersand` | 67,132 | 67,955 | +1.23% |
| `DeepTraversal` | 4,249,942 | 4,185,837 | -1.51% |
| `DeeplyNestedRendering` | 2,720 | 2,408 | -11.47% |
| `HugeArrayIteration` | 56,290,788 | 54,710,396 | -2.81% |
| `ComplexTemplateParsing` | 764,660,111 | 754,830,429 | -1.29% |
| `SmallTemplateParsing` | 4,853 | 4,828 | -0.52% |
| `PartialsRendering` | 223,235,384 | 225,555,792 | +1.04% |
| `LargeOutputString` | 598,101 | 566,055 | -5.36% |1 parent 91a3cd7 commit 6bf75e7
File tree
6 files changed
+739
-256
lines changed- clang-tools-extra/clang-doc
- llvm
- benchmarks
- include/llvm/Support
- lib/Support
- unittests/Support
- utils/llvm-test-mustache-spec
6 files changed
+739
-256
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
175 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
176 | 184 | | |
177 | 185 | | |
178 | 186 | | |
| |||
184 | 192 | | |
185 | 193 | | |
186 | 194 | | |
187 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
188 | 201 | | |
189 | 202 | | |
190 | 203 | | |
| |||
197 | 210 | | |
198 | 211 | | |
199 | 212 | | |
200 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
201 | 218 | | |
202 | 219 | | |
203 | 220 | | |
| |||
209 | 226 | | |
210 | 227 | | |
211 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
212 | 233 | | |
213 | | - | |
| 234 | + | |
214 | 235 | | |
215 | 236 | | |
216 | 237 | | |
217 | 238 | | |
218 | 239 | | |
219 | 240 | | |
220 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
221 | 246 | | |
222 | | - | |
| 247 | + | |
223 | 248 | | |
224 | 249 | | |
225 | 250 | | |
226 | 251 | | |
227 | 252 | | |
228 | 253 | | |
229 | 254 | | |
230 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
231 | 260 | | |
232 | 261 | | |
233 | 262 | | |
| |||
243 | 272 | | |
244 | 273 | | |
245 | 274 | | |
246 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
247 | 280 | | |
248 | 281 | | |
249 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
101 | | - | |
| 108 | + | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
| |||
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
113 | | - | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| |||
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
129 | | - | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
0 commit comments