Commit 3e803b4
squashing & signing (#8589)
This change introduces TagMap as replacement for HashMap when working with tags.
TagMap has two different implementations...
- one that extends a regular HashMap
- another that uses a different approach that allows for Entry sharing
This change currently uses the HashMap approach by default, but allows for switching to the optimized Map
via a configuration flag.
The optimized TagMap is designed to be good at operations that the tracer performs regularly but HashMap
isn't great at. Specifically, Map-to-Map copies and storing primitives.
To get the benefit of the optimized TagMap, calling code needs to use TagMap-s for both the source and destination map.
The calling code also needs to make sure to use the bulk operations that which are the most optimized.
To take advantage of TagMap in span creation, a mechanism was introduced that allows for bypassing TagInterceptors.
Bypassing TagInterceptors is done by analyzing a TagMap that is going to be reused ahead-of-time to determine if
interception is needed. If interception isn't needed, then SpanBuilder can use a bulk operation to update the map.
To maintain the insertion order semantics of SpanBuilder, TagMap also includes a Ledger.
A Ledger is concatenative ledger of entry modifications to a map
A Ledger is now used in place of a LinkedHashMap in SpanBuilder to provide the insertion order semantics.
Since these changes primarily serve to reduce allocation, they should the biggest gain in memory constrained environments.
In memory constrained environments, these changes yield a 10% increase in sustainable throughput with spring-petclinic.1 parent 0a08400 commit 3e803b4
File tree
51 files changed
+6897
-247
lines changed- dd-java-agent
- agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain
- agent-debugger/src/test/java/com/datadog/debugger/exception
- agent-iast/src/test/groovy/com/datadog/iast/sink
- appsec/src/test/groovy/com/datadog/appsec
- gateway
- instrumentation/websocket/javax-websocket-1.0/src/test/groovy
- dd-trace-api/src/main/java/datadog/trace/api/config
- dd-trace-core/src
- main/java/datadog/trace/core
- propagation
- taginterceptor
- tagprocessor
- test/groovy/datadog/trace
- common/writer
- core
- datastreams
- tagprocessor
- traceAgentTest/groovy
- internal-api/src
- main/java/datadog/trace
- api
- gateway
- naming
- v0
- v1
- bootstrap/instrumentation/api
- test
- groovy/datadog/trace/bootstrap/instrumentation/api
- java/datadog/trace/api
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+6897
-247
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
109 | | - | |
| 107 | + | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
176 | | - | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | | - | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
1008 | 1009 | | |
1009 | 1010 | | |
1010 | 1011 | | |
1011 | | - | |
| 1012 | + | |
1012 | 1013 | | |
1013 | 1014 | | |
1014 | 1015 | | |
| |||
1196 | 1197 | | |
1197 | 1198 | | |
1198 | 1199 | | |
1199 | | - | |
| 1200 | + | |
1200 | 1201 | | |
1201 | 1202 | | |
1202 | 1203 | | |
| |||
1214 | 1215 | | |
1215 | 1216 | | |
1216 | 1217 | | |
1217 | | - | |
| 1218 | + | |
1218 | 1219 | | |
1219 | 1220 | | |
1220 | 1221 | | |
| |||
1233 | 1234 | | |
1234 | 1235 | | |
1235 | 1236 | | |
1236 | | - | |
| 1237 | + | |
1237 | 1238 | | |
1238 | 1239 | | |
1239 | 1240 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
584 | 585 | | |
585 | 586 | | |
586 | 587 | | |
587 | | - | |
| 588 | + | |
588 | 589 | | |
589 | 590 | | |
590 | 591 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
0 commit comments