-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
**Description:** Switch libraries to reduce the footprint of the JSON parser. **Link to tracking Issue:** Fixes #33784 **Testing:** Before: ``` goos: darwin goarch: arm64 pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/json BenchmarkProcess-10 49047 23951 ns/op 26277 B/op 177 allocs/op BenchmarkProcess-10 50248 24002 ns/op 26275 B/op 177 allocs/op BenchmarkProcess-10 50258 24517 ns/op 26276 B/op 177 allocs/op BenchmarkProcess-10 50505 24731 ns/op 26276 B/op 177 allocs/op BenchmarkProcess-10 45708 24730 ns/op 26276 B/op 177 allocs/op BenchmarkProcess-10 50022 25021 ns/op 26277 B/op 177 allocs/op BenchmarkProcess-10 47204 24794 ns/op 26275 B/op 177 allocs/op BenchmarkProcess-10 47742 25335 ns/op 26274 B/op 177 allocs/op BenchmarkProcess-10 46252 25205 ns/op 26276 B/op 177 allocs/op BenchmarkProcess-10 47916 24379 ns/op 26277 B/op 177 allocs/op PASS ok github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/json 15.559s ``` After: ``` goos: darwin goarch: arm64 pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/json BenchmarkProcess-10 95613 12168 ns/op 14702 B/op 115 allocs/op BenchmarkProcess-10 97904 12343 ns/op 14704 B/op 115 allocs/op BenchmarkProcess-10 99006 12187 ns/op 14702 B/op 115 allocs/op BenchmarkProcess-10 96964 12310 ns/op 14703 B/op 115 allocs/op BenchmarkProcess-10 98661 12285 ns/op 14703 B/op 115 allocs/op BenchmarkProcess-10 96896 12356 ns/op 14703 B/op 115 allocs/op BenchmarkProcess-10 94118 12367 ns/op 14703 B/op 115 allocs/op BenchmarkProcess-10 96123 12349 ns/op 14702 B/op 115 allocs/op BenchmarkProcess-10 96948 12305 ns/op 14702 B/op 115 allocs/op BenchmarkProcess-10 96626 12225 ns/op 14702 B/op 115 allocs/op PASS ok github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/json 13.619s ``` Benchstat: ``` goos: darwin goarch: arm64 pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/json │ before.txt │ after.txt │ │ sec/op │ sec/op vs base │ Process-10 24.73µ ± 3% 12.31µ ± 1% -50.23% (p=0.000 n=10) │ before.txt │ after.txt │ │ B/op │ B/op vs base │ Process-10 25.66Ki ± 0% 14.36Ki ± 0% -44.05% (p=0.000 n=10) │ before.txt │ after.txt │ │ allocs/op │ allocs/op vs base │ Process-10 177.0 ± 0% 115.0 ± 0% -35.03% (p=0.000 n=10) ```
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: pkg/stanza | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Switch JSON parser used by json_parser to github.com/goccy/go-json | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [33784] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"_id": "667cb0db02f4dfc7648b0f6b", | ||
"index": 0, | ||
"guid": "2e419732-8214-4e36-a158-d3ced0217ab6", | ||
"isActive": true, | ||
"balance": "$1,105.05", | ||
"picture": "http://example.com/1", | ||
"age": 22, | ||
"eyeColor": "blue", | ||
"name": "Vincent Knox", | ||
"gender": "male", | ||
"company": "ANIVET", | ||
"email": "[email protected]", | ||
"phone": "+1 (914) 599-2454", | ||
"address": "483 Gerritsen Avenue, Succasunna, Massachusetts, 7803", | ||
"about": "Elit aliqua qui amet duis esse eiusmod cillum proident quis amet elit tempor dolor exercitation. Eu ut tempor exercitation excepteur est. Lorem ad elit sit reprehenderit quis ad sunt laborum amet veniam commodo sit sunt aliqua. Sint incididunt eu ut est magna amet mollit qui deserunt nostrud labore ad. Nostrud officia proident occaecat et irure ut quis culpa mollit veniam. Laboris labore ea reprehenderit veniam mollit enim et proident ipsum id. In qui sit officia laborum.\r\nIn ad consectetur duis ad nisi proident. Non in officia do mollit amet sint voluptate minim nostrud voluptate elit. Veniam Lorem cillum fugiat adipisicing qui ea commodo irure tempor ipsum pariatur sit voluptate. Eiusmod cillum occaecat excepteur cillum aliquip laboris velit aute proident amet.\r\nIpsum sunt eiusmod do ut voluptate sit anim. Consequat nisi nisi consequat amet excepteur ea ad incididunt pariatur veniam exercitation eu ex in. Incididunt sint tempor pariatur Lorem do. Occaecat laborum ad ad id enim dolor deserunt ipsum amet Lorem Lorem. Cillum veniam labore eu do duis.\r\nCillum dolor eiusmod sit amet commodo voluptate pariatur ex irure eu culpa sunt. Incididunt non exercitation est pariatur est. Incididunt mollit Lorem velit ullamco excepteur esse quis id magna et ullamco labore. Laboris consequat tempor est ea amet enim et nisi amet officia dolore magna veniam. Nostrud officia consectetur ea culpa laborum et ut Lorem laboris.\r\nDeserunt labore ullamco dolor exercitation laboris consectetur nulla cupidatat duis. Occaecat quis velit deserunt culpa nostrud eiusmod elit fugiat nulla duis deserunt Lorem do. Proident anim proident aute amet pariatur et do irure. Ad magna qui elit consequat sit exercitation sit. Magna adipisicing id esse aliqua officia magna. Et veniam aliqua minim reprehenderit in culpa. Adipisicing quis eu do Lorem cupidatat consequat ad aute quis.\r\nIn aliquip ea laborum esse dolor reprehenderit qui sit culpa occaecat. Consectetur Lorem dolore adipisicing amet incididunt. Dolor veniam Lorem nulla ex. Eiusmod amet tempor sit eiusmod do reprehenderit proident sit commodo elit cupidatat.\r\nNulla nulla consequat cillum mollit tempor eiusmod irure deserunt amet et voluptate. Fugiat et veniam culpa eiusmod minim ex pariatur. Eiusmod adipisicing pariatur pariatur adipisicing in consequat cillum ut qui veniam amet incididunt ullamco anim.\r\nDolor nulla laborum tempor adipisicing qui id. Exercitation labore aliqua ut laborum velit cupidatat officia. Est qui dolor sint laboris aliqua ea nulla culpa.\r\nAute reprehenderit nulla elit nisi reprehenderit pariatur officia veniam dolore ea occaecat nostrud sunt fugiat. Cillum consequat labore nostrud veniam nisi ea proident est officia incididunt adipisicing qui sint nisi. Ad enim reprehenderit minim labore minim irure dolor. Voluptate commodo dolor excepteur est tempor dolor sunt esse fugiat ea eu et.\r\nIpsum sit velit deserunt aliqua eu labore ad esse eu. Duis eiusmod non exercitation consequat nulla. Enim elit consectetur pariatur sunt labore sunt dolore non do. Sint consequat aliqua tempor consectetur veniam minim. Veniam eu aute occaecat consectetur dolore ullamco dolore officia.\r\n", | ||
"registered": "2023-06-08T12:29:06 +07:00", | ||
"latitude": -59.802339, | ||
"longitude": -160.473187, | ||
"tags": [ | ||
"pariatur", | ||
"anim", | ||
"id", | ||
"duis", | ||
"fugiat", | ||
"qui", | ||
"veniam" | ||
], | ||
"friends": [ | ||
{ | ||
"id": 0, | ||
"name": "Hester Bruce" | ||
}, | ||
{ | ||
"id": 1, | ||
"name": "Laurel Mcknight" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Wynn Moses" | ||
} | ||
], | ||
"greeting": "Hello, Vincent Knox! You have 1 unread messages.", | ||
"favoriteFruit": "apple" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.