Skip to content

Improve performance of normalizeUUID function. #3772

@kozaxinan

Description

@kozaxinan

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

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions