wookayin / expt

Experiment. Plot. Tabulate.
MIT License
68 stars 6 forks source link

Add path_util.session() to cache and reuse SSH/SFTP connections #12

Closed wookayin closed 2 years ago

wookayin commented 2 years ago

Handshaking and establishing SSH sessions (for SFTP) is expensive; consecutive and many numbers of path_util call while loading runs may take a lot of time if the SSH connection is not cached or re-used.

We add a context manager path_util.session(), within which SSH/SFTP connection resources can be cached and reused for a fast performance.

Part of #9 and improves the initial implementation in #10.