Commit e092c44
committed
Reducing allocation in interceptCompleteTrace
Introduced TraceList which is just an ArrayList that exposes the internal modCount
Being able to access the modCount allows interceptCompleteTrace to check if the list post-interception has been modified
If the list is the same & is unmodified, then interceptCompleteTrace is able to bypass making a defensive copy
As a further optimization, use of TraceList is pushed up to callers of interceptCompleteTrace and TraceCollector.write
That does mean StreamingTraceCollector can no longer used a singletonList, but the savings throughput the pipeline outweigh the cost of the extra Object[] in that case1 parent 8a33be4 commit e092c44
4 files changed
Lines changed: 50 additions & 14 deletions
File tree
- dd-trace-core/src/main/java/datadog/trace/core
Lines changed: 24 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
1205 | | - | |
| 1205 | + | |
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
| |||
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1245 | 1258 | | |
1246 | 1259 | | |
1247 | 1260 | | |
| |||
1255 | 1268 | | |
1256 | 1269 | | |
1257 | 1270 | | |
1258 | | - | |
1259 | | - | |
1260 | | - | |
1261 | | - | |
| 1271 | + | |
| 1272 | + | |
1262 | 1273 | | |
1263 | 1274 | | |
1264 | 1275 | | |
1265 | 1276 | | |
1266 | 1277 | | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1267 | 1281 | | |
| 1282 | + | |
| 1283 | + | |
1268 | 1284 | | |
1269 | | - | |
1270 | 1285 | | |
1271 | 1286 | | |
1272 | 1287 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
75 | | - | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
Lines changed: 22 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 | + | |
0 commit comments