From 3e8c8e2a6daa67254ec6ff6b9376cab4e15e477d Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Mon, 5 Aug 2024 15:49:24 -0700 Subject: [PATCH] Still dispatch the biggest tasks first --- tile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tile.cpp b/tile.cpp index 4f64802e..c7b254fd 100644 --- a/tile.cpp +++ b/tile.cpp @@ -836,6 +836,11 @@ static unsigned long long calculate_drop_sequence(serial_feature const &sf) { struct task { int fileno = 0; + size_t todo; + + bool operator<(const struct task &o) const { + return todo < o.todo; + } }; // This is the block of parameters that are passed to write_tile() to read a tile @@ -2971,9 +2976,12 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std:: } tasks[j].fileno = j; + tasks[j].todo = geom_size[j]; dispatch.push_back(&tasks[j]); } + std::sort(dispatch.begin(), dispatch.end()); + int err = INT_MAX; double zoom_gamma = gamma;