Skip to content

Metrics benchmarks make labels look much slower than they are. #739

@jdmarshall

Description

@jdmarshall

I realized today that I've been saying something about the labels code that is not true and it's down to how the tests are being run.

The problem is that when we run the benchmark with no labels, we call the benchmark n times and show that as the runtime for Counter.inc(), but when we measure the performance of labels, instead of testing one set of labels we are testing a combinatorial set of labels and so each test run is not measuring Counter.inc() but instead m^k runs of Counter.inc.

So any time I increase the number of labels or the cardinality of them it looks like the new test runs slower but it's testing more values.

I'm still working out how to fix this. I made a couple pattern changes in a new benchmark, benchmarks/defaultMetrics.js but it'll need more than this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions