Skip to content

Improve some tutorials to speed up the Continuous Documentation #825

Closed

Description

@seisman

This is a summary of running time of the PyGMT tutorials and examples:

computation time summary:
    - ../examples/tutorials/regions.py:                                   11.34 sec   0.0 MB
    - ../examples/tutorials/3d-perspective-image.py:                      10.06 sec   0.0 MB
    - ../examples/tutorials/frames.py:                                     6.56 sec   0.0 MB
    - ../examples/tutorials/lines.py:                                      5.86 sec   0.0 MB
    - ../examples/gallery/grid/grdview_surface.py:                         5.47 sec   0.0 MB
    - ../examples/tutorials/earth-relief.py:                               5.32 sec   0.0 MB
    - ../examples/tutorials/text.py:                                       4.63 sec   0.0 MB
    - ../examples/tutorials/contour-map.py:                                3.88 sec   0.0 MB
    - ../examples/tutorials/coastlines.py:                                 3.07 sec   0.0 MB
    - ../examples/tutorials/plot.py:                                       2.58 sec   0.0 MB
    - ../examples/projections/azim/azim_general_perspective.py:            2.36 sec   0.0 MB
    - ../examples/tutorials/first-figure.py:                               1.71 sec   0.0 MB
    - ../examples/tutorials/configuration.py:                              1.58 sec   0.0 MB
    - ../examples/gallery/coast/borders.py:                                1.45 sec   0.0 MB
    - ../examples/gallery/plot/scatter3d.py:                               1.23 sec   0.0 MB
    - ../examples/gallery/grid/track_sampling.py:                          1.18 sec   0.0 MB
    - ../examples/projections/cyl/cyl_cassini.py:                          0.99 sec   0.0 MB
    - ../examples/projections/azim/azim_equidistant.py:                    0.93 sec   0.0 MB
    - ../examples/gallery/line/line-custom-cpt.py:                         0.91 sec   0.0 MB
    - ../examples/gallery/coast/shorelines.py:                             0.89 sec   0.0 MB
    - ../examples/projections/conic/conic_albers.py:                       0.85 sec   0.0 MB
    - ../examples/gallery/coast/land_and_water.py:                         0.83 sec   0.0 MB
    - ../examples/gallery/plot/image.py:                                   0.82 sec   0.0 MB
    - ../examples/gallery/plot/scatter.py:                                 0.73 sec   0.0 MB
    - ../examples/projections/cyl/cyl_universal_transverse_mercator.py:    0.70 sec   0.0 MB
    - ../examples/gallery/plot/logo.py:                                    0.67 sec   0.0 MB
    - ../examples/projections/azim/azim_gnomonic.py:                       0.67 sec   0.0 MB
    - ../examples/projections/misc/misc_van_der_grinten.py:                0.66 sec   0.0 MB
    - ../examples/projections/nongeo/polar.py:                             0.66 sec   0.0 MB
    - ../examples/projections/azim/azim_orthographic.py:                   0.66 sec   0.0 MB
    - ../examples/projections/cyl/cyl_miller.py:                           0.65 sec   0.0 MB
    - ../examples/projections/azim/azim_general_stereographic.py:          0.65 sec   0.0 MB
    - ../examples/projections/misc/misc_winkel_tripel.py:                  0.64 sec   0.0 MB
    - ../examples/projections/nongeo/cartesian_logarithmic.py:             0.64 sec   0.0 MB
    - ../examples/projections/conic/conic_lambert.py:                      0.63 sec   0.0 MB
    - ../examples/gallery/plot/legend.py:                                  0.62 sec   0.0 MB
    - ../examples/gallery/line/linestyles.py:                              0.61 sec   0.0 MB
    - ../examples/projections/cyl/cyl_equal_area.py:                       0.61 sec   0.0 MB
    - ../examples/projections/cyl/cyl_transverse_mercator.py:              0.58 sec   0.0 MB
    - ../examples/projections/conic/polyconic.py:                          0.58 sec   0.0 MB
    - ../examples/projections/nongeo/cartesian_power.py:                   0.57 sec   0.0 MB
    - ../examples/projections/cyl/cyl_equidistant.py:                      0.57 sec   0.0 MB
    - ../examples/projections/misc/misc_eckertVI.py:                       0.57 sec   0.0 MB
    - ../examples/gallery/plot/colorbar.py:                                0.56 sec   0.0 MB
    - ../examples/gallery/plot/points.py:                                  0.56 sec   0.0 MB
    - ../examples/projections/cyl/cyl_mercator.py:                         0.55 sec   0.0 MB
    - ../examples/projections/misc/misc_eckertIV.py:                       0.55 sec   0.0 MB
    - ../examples/projections/misc/misc_hammer.py:                         0.55 sec   0.0 MB
    - ../examples/projections/azim/azim_lambert.py:                        0.55 sec   0.0 MB
    - ../examples/projections/nongeo/cartesian_linear.py:                  0.55 sec   0.0 MB
    - ../examples/gallery/plot/points-transparency.py:                     0.55 sec   0.0 MB
    - ../examples/projections/cyl/cyl_stereographic.py:                    0.55 sec   0.0 MB
    - ../examples/projections/misc/misc_robinson.py:                       0.55 sec   0.0 MB
    - ../examples/projections/misc/misc_sinusoidal.py:                     0.54 sec   0.0 MB
    - ../examples/projections/misc/misc_mollweide.py:                      0.53 sec   0.0 MB
    - ../examples/projections/conic/conic_equidistant.py:                  0.53 sec   0.0 MB
    - ../examples/gallery/plot/meca.py:                                    0.53 sec   0.0 MB
    - ../examples/gallery/plot/datetime-inputs.py:                         0.46 sec   0.0 MB
    - ../examples/gallery/plot/multi-parameter-symbols.py:                 0.46 sec   0.0 MB

For example, examples/tutorials/regions.py takes more than 10 seconds. I guess it's slow because the two global examples plot borders of all countries. However, these borders are not necessary here, as we are showing how to set regions in the tutorial.

I don't check other tutorials, but I believe some tutorials, especially the slowest ones can be much faster if we are more careful about choosing the arguments.

Activity

  1. added
    documentation
    enhancement
    help wanted
    maintenance
    on Jan 31, 2021
  2. seisman commented on Feb 6, 2021

    @seisman
    MemberAuthor

    examples/tutorials/3d-perspective-image.py is slow, because this example uses earth_relief_05m_p, but only earth_relief_05m_g is cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationenhancementhelp wantedmaintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions