Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Logs] Avoid temporary vector to store attributes. #1799

Closed
cijothomas opened this issue May 22, 2024 · 0 comments · Fixed by #1814
Closed

[Logs] Avoid temporary vector to store attributes. #1799

cijothomas opened this issue May 22, 2024 · 0 comments · Fixed by #1814
Assignees

Comments

@cijothomas
Copy link
Member

cijothomas commented May 22, 2024

Appender's Visitor creates own vec! and pushes items into it.
And then a new vec! is allocated inside LogRecord and the above is copied to it

Opening an issue to track avoiding this intermediate array. The EventVisitor can be given the LogRecord itself while newing up, so it can record attributes directly to LogRecord. Or alternatively, expose another API to accept a Vec! (taking ownership) - I tried this in https://github.com/open-telemetry/opentelemetry-rust/compare/main...cijothomas:cijothomas/logrecord-addattribute?expand=1, which boosts stress test from ~27M/sec to ~34M/sec, and improves bencmark for ot_layer_enabled from 560ns to 450ns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants