Skip to content

Bench underestimates covered search area by a factor of 4 #62

@muendlein

Description

@muendlein

Currently Math.random() * boxSize is used to set the delta between min and max (=box length) which will on average only give 0.5*boxSize reducing the box area by a factor of 4.

flatbush/bench.js

Lines 14 to 20 in 3a6f0f0

function addRandomBox(arr, boxSize) {
const x = Math.random() * (100 - boxSize);
const y = Math.random() * (100 - boxSize);
const x2 = x + Math.random() * boxSize;
const y2 = y + Math.random() * boxSize;
arr.push(x, y, x2, y2);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions