make json_delta faster

This commit is contained in:
Henning Jacobs
2023-05-10 13:24:12 +02:00
parent eca2032e3f
commit 43c19c400d
6 changed files with 250 additions and 275 deletions

View File

@@ -89,7 +89,7 @@ def update_clusters(
# https://pikacode.com/phijaro/json_delta/ticket/11/
# diff is extremely slow without array_align=False
delta = json_delta.diff(
old_data, data, verbose=debug, array_align=False
old_data, data, verbose=debug, array_align=False, compare_lengths=False
)
store.publish(
"clusterdelta",
@@ -116,5 +116,5 @@ def update_clusters(
logger.exception(f"Failed to update: {e}")
finally:
store.release_lock(lock)
# sleep 1-2 seconds
gevent.sleep(min(random_jitter(1), query_interval))
# sleep 2-3 seconds
gevent.sleep(min(random_jitter(2), query_interval))