NOAA-OWP / t-route

Tree based hydrologic and hydraulic routing
Other
44 stars 50 forks source link

Optimizing read_geopkg function #819

Closed AminTorabi-NOAA closed 3 months ago

AminTorabi-NOAA commented 3 months ago

This PR improves the speed of read_geopkg function, with below changes. : (It improve the Duration by 20% and CPU Time by 50%)

  1. Optimized Parallel Processing. Used min(cpu_pool, len(layers)) to ensure we don't create more parallel jobs than layers, which avoids unnecessary overhead.

  2. Reduced Repetition: Removed repeated code for reading layers by creating a read_layer function.

  3. Ensured Efficiency: Removed unnecessary list creation and directly accessed the table_dict.

    Additions

-

Removals

-

Changes

Originally it was taking 2.47 sec image

after the changes it takes 1.96 sec which is 20% improvement: image

Testing

1.

Screenshots

Notes

-

Todos

-

Checklist

Testing checklist

Target Environment support

Accessibility

Other