Nextdoor / ndserviceregistry

Nextdoor ServiceRegistry Foundational Python Class
27 stars 12 forks source link

Improve the performance of the Watcher.get() method. #63

Open diranged opened 9 years ago

diranged commented 9 years ago

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.

https://github.com/Nextdoor/ndserviceregistry/blob/master/nd_service_registry/watcher.py#L117-L124

CC: @skrawcz