Skip to content

Conversation

@kamstrup
Copy link
Contributor

Description

We are seeing pcommon/Map.AsRaw() show up in the memory profiles.

This PR ensure we pre-allocate a map[string]any of the expected size, instead of just an empty map.

@kamstrup kamstrup requested review from a team, bogdandrutu and dmitryax as code owners February 17, 2025 15:02
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: bogdandrutu / name: Bogdan Drutu (305c92d)
  • ✅ login: kamstrup / name: Mikkel Kamstrup Erlandsen (0dabdfb, e0578fa)

@bogdandrutu
Copy link
Member

This PR is ok, but I am curious why do you need to call this function and in which component?

@codecov
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.10%. Comparing base (cffb7b6) to head (305c92d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12406   +/-   ##
=======================================
  Coverage   92.10%   92.10%           
=======================================
  Files         465      465           
  Lines       25180    25180           
=======================================
  Hits        23191    23191           
  Misses       1592     1592           
  Partials      397      397           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bogdandrutu
Copy link
Member

bogdandrutu commented Feb 17, 2025

Please add a changelog entry

@github-actions github-actions bot requested a review from bogdandrutu February 19, 2025 13:50
@kamstrup
Copy link
Contributor Author

Please add a changelog entry

Done :-)

@bogdandrutu
Copy link
Member

@kamstrup ping on

but I am curious why do you need to call this function and in which component?

@kamstrup
Copy link
Contributor Author

@kamstrup ping on

but I am curious why do you need to call this function and in which component?

Good question :-) We have custom storage engine and we do some massaging of otel payloads to store them most efficiently. We pull the attributes out as a map and rearrange the data.

When we have huge nested maps AsRaw starts to show up in the profiles. Not a deal breaker by any means, of course, but just thought it was a nice small improvement

@bogdandrutu bogdandrutu added this pull request to the merge queue Feb 24, 2025
Merged via the queue into open-telemetry:main with commit 362db71 Feb 24, 2025
54 checks passed
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 this pull request may close these issues.

3 participants