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

Improve performance of normalizeUUID function. #3772

Open
kozaxinan opened this issue Oct 7, 2024 · 1 comment
Open

Improve performance of normalizeUUID function. #3772

kozaxinan opened this issue Oct 7, 2024 · 1 comment
Assignees

Comments

@kozaxinan
Copy link

kozaxinan commented Oct 7, 2024

Problem Statement

normalizeUUID is called on main thread and cause 2-10 ms operation on production application.

There are low handing fruits.

DefaultTransactionPerformanceCollector.start calls transaction.getEventId().toString() twice and it basically make same operation. It uses normalizeUUID under the hood which take time.

Solution Brainstorm

Please assign transaction.getEventId().toString() to a val and dont do computation again.
convert performanceDataMap to map of EventId instead of string and dont do EventId to String conversion while creating a trace.

I didnt check all usages of toString, it will be nice to check them and consider not unboxing the toString on main thread

or cache the value of toString and hashCode with lazy.

┆Issue is synchronized with this Jira Improvement by Unito

@Angelodaniel Angelodaniel added the Sync: Jira apply to auto-create a Jira shadow ticket label Oct 7, 2024
@kozaxinan
Copy link
Author

kozaxinan commented Oct 7, 2024

The profiler app is nondebuggable app with proguard (not R8) production application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: Backlog
Development

No branches or pull requests

3 participants