elastic / elastic/ecs-dotnet

Suggestion: Consider using StringBuilder pooling

Open
#506 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
137
Forks
70
PR merge metrics
No merged PRs in 30d

Description

https://github.com/elastic/ecs-dotnet/blob/8bceb425bc616d6d63e7f572ddb56f3c012e774b/src/Elastic.Extensions.Logging.Common/LogEventBuilderExtensions.cs#L148

Consider pooling StringBuilder instances (e.g., via ObjectPool) instead of creating a new one per call; re-use removes per-call allocations and virtually eliminates Gen-0 GC pressure.

Contributor guide

Open the contributing guide

Research direction

Start at src/Elastic.Extensions.Logging.Common/LogEventBuilderExtensions.cs:148 and inspect how the StringBuilder is created and consumed. Check the surrounding logging code for an existing pooling pattern, then verify that pooling removes the per-call allocation without changing the generated log output.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.