Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull from the back of the list of tiles to overzoom, not the front #149

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.34.1

* Further improvements to tile-join speed

# 2.34.0

* Improve speed of overzooming in tile-join
Expand Down
13 changes: 7 additions & 6 deletions tile-join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,14 @@ double max(double a, double b) {
struct tilecmp {
bool operator()(std::pair<unsigned, unsigned> const &a, std::pair<unsigned, unsigned> const &b) {
// must match behavior of tileset_reader::operator<()
// except backwards, since we are pulling from the end of the list

if (a.first < b.first) {
if (b.first < a.first) {
return true;
}
if (a.first == b.first) {
if (b.first == a.first) {
// Y sorts backwards, in TMS order
if (a.second > b.second) {
if (b.second > a.second) {
return true;
}
}
Expand Down Expand Up @@ -555,8 +556,8 @@ struct tileset_reader {
return;
}

auto xy = overzoomed_tiles.front();
overzoomed_tiles.erase(overzoomed_tiles.begin());
auto xy = overzoomed_tiles.back();
overzoomed_tiles.erase(overzoomed_tiles.begin() + overzoomed_tiles.size() - 1);

x = xy.first;
y = xy.second;
Expand Down Expand Up @@ -1061,7 +1062,7 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
// Then this tile is done and we can safely run the output queue.

if (readers == NULL || readers->zoom != current.first.z || readers->x != current.first.x || readers->y != current.first.y) {
if (tasks.size() > 10 * CPUS) {
if (tasks.size() > 100 * CPUS) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from 100 to 10 in the last PR was accidental, left over from testing whether that would reduce memory usage. Restoring it to 100 does not make a big difference to total running time but does reduce time spent on I/O.

dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers);
tasks.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion version.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP

#define VERSION "v2.34.0"
#define VERSION "v2.34.1"

#endif