mirror of https://github.com/zulip/zulip.git
7feda75c5f
The post-delete signal on AlertWord clears the realm cache; when it is called repeatedly, this results in re-fetching the realm object O(n) times, where n scales by number of users in the database. Disconnect this cache-clearing signal before removing the AlertWord entries, and reconnect it afterwards. This is not thread-safe, but this section is single-threaded. It is also probably unnecessary to re-connect the signal, as rest of `./manage.py populate_db` does not delete AlertWord objects, but cleanliness dictates doing the re-connection. This drops the time to repeatedly run: python3 ./manage.py populate_db --num-messages=0 --extra-users=1000 ...from 47 seconds to 36 seconds. |
||
---|---|---|
.. | ||
commands | ||
__init__.py |