Skip to content

Relation reading performance #295

@systemed

Description

@systemed

I'm trying with the full planet right now, including #292 to reduce memory usage a bit, and node/way read performance is generally encouraging. (144GB RAM, 8GB swap, store on SSD.)

However, relation reading is glacially slow, probably unusably so. Nodes/ways were read overnight, but it looks like relations will take several days.

Relation performance is never going to be fast because we have to assemble, and correct, complex multipolygon geometries. Even so, we should be able to improve on this.

htop shows most CPUs running at around 1%. I'm not sure how much of this is IO-bound: the status column is mostly S (interruptible sleep) rather than D (uninterruptible), which would suggest we're not IO-bound, but IO_RATE shows we're shipping 100M/s of data. The progress display often 'slips' back to an earlier block, which might indicate that it's getting stuck on particularly complex geometries.

A few thoughts:

  • 432f394 might help - this uses a std::deque when adding member ways together rather than a std::vector, because often they need to be added to the front of the current linestring
  • Worth resurrecting Fix performance regression in polygon make_valid #258?
  • In verbose mode, we could log relations that take more than n ms to parse, which might help pin down issues

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions