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

Optimize Z9 rendering #645

Merged
merged 1 commit into from
Mar 4, 2023
Merged

Optimize Z9 rendering #645

merged 1 commit into from
Mar 4, 2023

Conversation

Phyks
Copy link
Member

@Phyks Phyks commented Mar 4, 2023

Z9 was quite anomaly in terms of rendering time. It was taking much longer than Z8 and Z10 during pre-computation.

Dominant layer was landuse_gen0. It was using subpixel rendering for landuse, which is useful at very low zoom but seems to be safely discardable at Z9.

Also add checking of way geometries against bboxes to ensure correct usage of geospatial indexes in db.

See as well
gravitystorm/openstreetmap-carto#2874 and gravitystorm/openstreetmap-carto#3458 (comment).

See #644.

Screenshots

Before change

2023-03-04-191940

After change

2023-03-04-191943

SQL timings

Before change

+-----------+----------------+-----------------------+-----------------+---------------------------+---------+
| Time (ms) | #lines fetched |         Layer         | #fields fetched | Size (text format, in kB) | #points |
+-----------+----------------+-----------------------+-----------------+---------------------------+---------+
|   155739  |     87807      |      landuse_gen0     |        6        |           93472           | 2724436 |
|   72884   |      241       |    protected-areas    |        7        |           21552           |  672438 |
|   21497   |      2886      |    landuse-overlay    |        6        |           75216           | 2337983 |
|   20718   |       64       |    military-overlay   |        6        |            386            |  11941  |
|   14091   |      856       |       water_gen0      |        5        |           19231           |  598569 |
|   13813   |     226936     |       roads_med       |        5        |           31984           |  715500 |
|   10909   |     23439      | bicycle_routes_labels |        9        |           110236          | 3383817 |
|    4262   |     29195      |      waterway_low     |        4        |           10035           |  280558 |
|    4198   |      659       |     admin-low-zoom    |        4        |           22069           |  688972 |
|    3338   |       23       |      state-names      |        6        |           32326           | 1008810 |
|    3125   |       9        |     country-names     |        5        |           20773           |  648968 |
|    1170   |     11270      |  bicycle_routes_gen2  |        6        |            1641           |  35559  |
|    264    |      1470      |   placenames-medium   |        7        |            109            |   1470  |
|     86    |      400       |      ferry-routes     |        4        |            168            |   4846  |
|     33    |       4        |     capital-names     |        6        |             0             |    4    |
+-----------+----------------+-----------------------+-----------------+---------------------------+---------+

After change

+-----------+----------------+-----------------------+-----------------+---------------------------+---------+
| Time (ms) | #lines fetched |         Layer         | #fields fetched | Size (text format, in kB) | #points |
+-----------+----------------+-----------------------+-----------------+---------------------------+---------+
|   22350   |      9067      |      landuse_gen1     |        6        |           203399          | 6321176 |
|   14217   |      856       |       water_gen0      |        5        |           19231           |  598569 |
|   13356   |     226936     |       roads_med       |        5        |           31984           |  715500 |
|   11347   |     23479      | bicycle_routes_labels |        9        |           110715          | 3398663 |
|    8064   |      2886      |    landuse-overlay    |        6        |           75216           | 2337983 |
|    4483   |     29195      |      waterway_low     |        4        |           10035           |  280558 |
|    4434   |      659       |     admin-low-zoom    |        4        |           22069           |  688972 |
|    3300   |       23       |      state-names      |        6        |           32326           | 1008810 |
|    2087   |       9        |     country-names     |        5        |           20773           |  648968 |
|    2034   |      241       |    protected-areas    |        7        |           21552           |  672438 |
|    1341   |     11270      |  bicycle_routes_gen2  |        6        |            1641           |  35559  |
|    428    |       64       |    military-overlay   |        6        |            386            |  11941  |
|    262    |      1470      |   placenames-medium   |        7        |            109            |   1470  |
|     29    |      400       |      ferry-routes     |        4        |            168            |   4846  |
|     16    |       4        |     capital-names     |        6        |             0             |    4    |
+-----------+----------------+-----------------------+-----------------+---------------------------+---------+

Z9 was quite anomaly in terms of rendering time. It was taking much
longer than Z8 and Z10 during pre-computation.

Dominant layer was landuse_gen0. It was using subpixel rendering for
landuse, which is useful at very low zoom but seems to be safely
discardable at Z9.

See as well
gravitystorm/openstreetmap-carto#2874 and
gravitystorm/openstreetmap-carto#3458 (comment).

See #644.
@Phyks Phyks merged commit d3bfe49 into master Mar 4, 2023
Phyks added a commit that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant