Currently the Watcher.get() method generates a fresh dict {} and populates it before returning it to the caller. This is fine, but not fast -- calling this over and over again is slow, especially if you have a large payload. We should do this once during the Watcher._update() method call, and be done.
Currently the
Watcher.get()
method generates a fresh dict{}
and populates it before returning it to the caller. This is fine, but not fast -- calling this over and over again is slow, especially if you have a large payload. We should do this once during theWatcher._update()
method call, and be done.https://github.com/Nextdoor/ndserviceregistry/blob/master/nd_service_registry/watcher.py#L117-L124
CC: @skrawcz