Skip to content

Commit a943565

Browse files
mcollinaclaude
authored andcommitted
perf: avoid array conversion in getMetricsAsJSON
Replace this.getMetricsAsArray() with direct iteration over this._metrics.values() to eliminate unnecessary Array.from() conversion. Performance improvement: ~1.3% faster (3,216 -> 3,259 calls/sec) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b47e854 commit a943565

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/registry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class Registry {
137137

138138
const promises = [];
139139

140-
for (const metric of this.getMetricsAsArray()) {
140+
for (const metric of this._metrics.values()) {
141141
promises.push(metric.get());
142142
}
143143

0 commit comments

Comments
 (0)