reduce large source of memory allocations in AllHosts
Overview
When siac runs siac hostdb -v
, it grabs all hosts once per active host. Part of this operation is a really tight loop that does a ton of allocations. This MR cleans up that loop to do fewer allocations.
I had an OOM on my machine while in the middle of this loop.
We should probably at some point consider a solution so that siac hostdb -v
doesn't load all hosts once per active host, but in the meantime this both significantly improved performance and fixed a big source of GC pressure.
Checklist
Review and complete the checklist to ensure that the MR is complete before assigned to an approver.
-
All new methods or updated methods have clear docstrings -
Testing added or updated for new methods -
Any new packages are added to Makefile and .gitlab-ci.yml -
API documentation updated for API updates -
Module README.md updated for changes to workflow -
Issue added to Sia-UI repo for new supporting features -
Changelog File Created
Issues Closed
Edited by David Vorick