Use static JSONEncoders
using json.dumps with custom options requires us to create a new JSONEncoder on each call. It's more efficient to create one upfront and reuse it.
Showing
- synapse/handlers/message.py 2 additions, 2 deletionssynapse/handlers/message.py
- synapse/replication/tcp/commands.py 5 additions, 3 deletionssynapse/replication/tcp/commands.py
- synapse/storage/events.py 8 additions, 15 deletionssynapse/storage/events.py
- synapse/util/frozenutils.py 19 additions, 0 deletionssynapse/util/frozenutils.py
Loading
Please register or sign in to comment