Closed Bug 1762612 Opened 3 years ago Closed 3 years ago

glean-core's LabeledMetric::get probably shouldn't create new metrics each time, right?

Categories

(Data Platform and Tools :: Glean: SDK, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chutten, Unassigned)

Details

We clone() fresh copies of submetrics on each all to LabeledMetric::get. ...do we have to? Shouldn't we instead cache these submetrics so we aren't allocating on each instrumentation call?

The new UniFFI-based code uses a map and Arc to cache these.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.