On the back of #798, there is now an opportunity to escape label names once at insert time rather than on every metrics call.
The metrics call is a high priority target for both time and space improvements. When I first came to the project, it was the most common complaint in the issue backlog. We have managed to speed up everything but this part. Collection is ~20% faster, aggregation 2.4x faster, but metrics are only a couple % faster.
With the introduction of #insert, we should be able to move the escapeString() call to insert. This could be done two ways:
- change the labels to only be escaped labels
- store the escaped form of the labels beside the original form
Number 2 may be more compatible, and since most strings do not need to be escaped in the first place, represent only a small increase in memory usage.
On the back of #798, there is now an opportunity to escape label names once at insert time rather than on every metrics call.
The metrics call is a high priority target for both time and space improvements. When I first came to the project, it was the most common complaint in the issue backlog. We have managed to speed up everything but this part. Collection is ~20% faster, aggregation 2.4x faster, but metrics are only a couple % faster.
With the introduction of #insert, we should be able to move the
escapeString()call to insert. This could be done two ways:Number 2 may be more compatible, and since most strings do not need to be escaped in the first place, represent only a small increase in memory usage.