rust-s2 icon indicating copy to clipboard operation
rust-s2 copied to clipboard

Large Memory Consumption on Region Covering

Open KarlRunge opened this issue 9 months ago • 1 comments

While trying to cover a region of lat lon (Lat: -37 -> -38, Lon: 147 -> 148), While getting all the CellIds in that region. The function call seems to use approx 2.5gb of RAM, which what should be approx 200mb.

Reproduction code:

let coverer = s2::region::RegionCoverer {
    min_level: 19,
    max_level: 19,
    level_mod: 0,
    max_cells: usize::MAX,
};

let rect = s2::rect::Rect::from_degrees(
    -38.0,
    144.0,
    -37.0,
    145.0,
);
let children_cells = coverer.covering(&rect).0;

KarlRunge avatar May 06 '24 00:05 KarlRunge