Skip to content

Optimize Face Bounds Construction #730

Closed

Description

@philipc2

Proposed new feature or change:

Optimize the performance when constructing Grid.face_bounds

Activity

  1. added
    new feature
    on Mar 20, 2024
  2. moved this from 📚 Backlog to 📝 To-Do in UXarray Developmenton Mar 20, 2024
  3. erogluorhan commented on Apr 2, 2024

    @erogluorhan
    Member

    Re @philipc2's benchmarking:

    The GeoFlow grid (12s execution time) has 6000 nodes and 3840 faces.

    That's extremely slow for such a small grid (though relatable as the algorithm iterates over each face, and each edge of that face). Taking into account bigger grids might be used, the execution times might make the things impractical, and that makes me think that we should consider either to optimize before a release, or provide caution admonitions, if possible, in the documentation to let the user clearly know the extreme performance bottleneck.

    Thoughts?

    Originally posted by @erogluorhan in #692 (review)

  4. erogluorhan commented on Apr 3, 2024

    @erogluorhan
    Member

    Some for-loop-based code needs to be replaced with vectorized ones the issue #346. Though, as part of here (if #346 will take too long), should we still find some intermediate (though not ideal) solutions to make our code look better I believe (rather than using a for loop and list appends), e.g. something like the following?:

    face_edges_connectivity_cartesian = np.asarray(list(map(node_lonlat_rad_to_xyz, face_edges_connectivity_lonlat)))

    Originally posted by @erogluorhan in #692 (comment)

  5. philipc2 commented on Apr 3, 2024

    @philipc2
    MemberAuthor

    We should also investigate the performance of lower-level helper functions that are called throughout.

    • _pole_point_inside_polygon
    • extreme_gca_latitude
    • _insert_pt_in_latlonbox
    • _get_cartesian_face_edge_nodes
    • _get_lonlat_rad_face_edge_nodes
  6. moved this from 📝 To-Do to No status in UXarray Developmenton Jul 25, 2024
  7. hongyuchen1030 commented on Jul 25, 2024

    @hongyuchen1030
    Contributor

    Hi @erogluorhan @philipc2,

    Since the zonal_mean feature is ready for review, can we prioritize the optimization for latlon bounds next? This optimization is the building block for our zonal_mean, a fundamental, core feature that many users are eagerly waiting to use.

    Thank you!

  8. erogluorhan commented on Jul 30, 2024

    @erogluorhan
    Member

    Hey @hongyuchen1030, sure!

  9. self-assigned this
    on Aug 6, 2024
  10. moved this to 🏗 In progress in UXarray Developmenton Aug 6, 2024
  11. linked a pull request that will close this issueOptimize Face Bounds Computation #877on Aug 9, 2024
  12. moved this from 🏗 In progress to ✅ Done in UXarray Developmenton Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new feature

Type

No type

Fields

Priority

None yet

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions