-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
Description
Component(s)
No response
Is your feature request related to a problem? Please describe.
The SplitString function has a significant performance bottleneck caused by inefficient string concatenation when processing long input strings. This leads to excessive memory allocations and high GC pressure, resulting in degraded performance (especially with strings longer than 1KB).
| current += string(input[i]) |
Test Case:
processors:
transform/standard:
error_mode: silent
log_statements:
- context: log
statements:
- set(attributes["log.type"], "test")
- merge_maps(cache, ParseKeyValue(body), "upsert")
service:
pipelines:
logs/main:
receivers: [filelog/log_file]
processors: [transform/standard]
exporters: [debug]This is the cpu profile of otel collector

Describe the solution you'd like
use strings.Builder instead
Describe alternatives you've considered
No response
Additional context
Use strings.Builder
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Reactions are currently unavailable