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

implement allocation free fast path for isBoolean and isNull #41

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

paulcacheux
Copy link
Contributor

@paulcacheux paulcacheux commented Nov 9, 2024

Example profile where those 2 small functions end up representing 6% of the total allocations of the agent.

I was surprised those functions even allocate in the first place, but it makes sense because of the case insensitive nature of the check. To improve a bit the situation, this PR adds some allocation free fast paths, checking directly for the most common cases (all lower or all upper cases).

@paulcacheux paulcacheux marked this pull request as ready for review November 9, 2024 19:55
@paulcacheux paulcacheux requested a review from a team as a code owner November 9, 2024 19:55
@paulcacheux
Copy link
Contributor Author

@lu-zhengda feel free to merge this when you want (I don't have the rights to do so). Thanks !

@lu-zhengda lu-zhengda merged commit 96160b1 into DataDog:main Nov 12, 2024
4 checks passed
@lu-zhengda
Copy link
Collaborator

@paulcacheux I've pushed a new tag v0.0.17 to include this memory improvement

@paulcacheux
Copy link
Contributor Author

thanks a lot !

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.

2 participants