Skip to content

NaN is given as ratio when the previous value is 0 #204

@miparnisari

Description

@miparnisari
image

If a previous benchmark is 0, don't try to divide here

const ratio = biggerIsBetter(curSuite.tool)
? prev.value / current.value // e.g. current=100, prev=200
: current.value / prev.value;

or here

const ratio = biggerIsBetter(config.tool)
? previousBench.value / bench.value
: bench.value / previousBench.value;

or here

const ratio = biggerIsBetter(curSuite.tool)
? prev.value / current.value // e.g. current=100, prev=200
: current.value / prev.value; // e.g. current=200, prev=100

(Why are there three places doing a division? 😆 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions