Freeze allocated objects on startup.
This may make gc go a bit faster as the gc will know things like caches/data stores etc. are frozen without having to check.
This commit is contained in:
@@ -279,6 +279,12 @@ def start(hs, listeners=None):
|
||||
|
||||
setup_sentry(hs)
|
||||
setup_sdnotify(hs)
|
||||
|
||||
# We now freeze all allocated objects in the hopes that (almost)
|
||||
# everything currently allocated are things that will be used for the
|
||||
# rest of time. Doing so means less work each GC (hopefully)
|
||||
gc.collect()
|
||||
gc.freeze()
|
||||
except Exception:
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
reactor = hs.get_reactor()
|
||||
|
||||
Reference in New Issue
Block a user