Skip to content

Please add caching for regex pattern in PerfMetricValidator#validateAttribute #6862

@PiotrBandurski

Description

@PiotrBandurski

During debugging performance issues I found out that sdk is not caching regexes which can add additional computation overhead (which is performed on main thread since sdk adds listener to fragment manager)

Problem is here PerfMetricValidator#validateAttribute(:

if (!key.matches("^(?!(firebase_|google_|ga_))[A-Za-z][A-Za-z_0-9]*")) {

Here is example from method sampling (I know this does not show real timming but in my case it takes 1/3 of computation time in trace)

Image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions