Commit dfa206a
committed
pkg/logs/processor: use custom marshaler for json payload message
Change jsonPayload Message field type to use encoding.TextMarshaler/TextUnmarshaler
to avoid allocation due to conversion of valid UTF-8 bytes to string in the common case.
```
goos: darwin
goarch: arm64
pkg: github.com/DataDog/datadog-agent/pkg/logs/processor
cpu: Apple M4 Max
│ HEAD~1 │ HEAD │
│ sec/op │ sec/op vs base │
JSONEncoder_Encode/valid-16 563.1n ± 17% 543.7n ± 12% -3.45% (p=0.009 n=10)
JSONEncoder_Encode/invalid-16 567.0n ± 1% 550.0n ± 1% -3.00% (p=0.000 n=10)
geomean 565.0n 546.8n -3.22%
│ HEAD~1 │ HEAD │
│ B/op │ B/op vs base │
JSONEncoder_Encode/valid-16 1.127Ki ± 0% 1.017Ki ± 0% -9.79% (p=0.000 n=10)
JSONEncoder_Encode/invalid-16 1.127Ki ± 0% 1.017Ki ± 0% -9.79% (p=0.000 n=10)
geomean 1.127Ki 1.017Ki -9.79%
│ HEAD~1 │ HEAD │
│ allocs/op │ allocs/op vs base │
JSONEncoder_Encode/valid-16 10.000 ± 0% 9.000 ± 0% -10.00% (p=0.000 n=10)
JSONEncoder_Encode/invalid-16 10.000 ± 0% 9.000 ± 0% -10.00% (p=0.000 n=10)
geomean 10.00 9.000 -10.00%
```1 parent 615fc90 commit dfa206a
File tree
5 files changed
+50
-18
lines changed- cmd/agent/subcommands/analyzelogs
- pkg/logs/processor
5 files changed
+50
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
18 | 19 | | |
19 | 20 | | |
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 | + | |
21 | 52 | | |
22 | 53 | | |
23 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments