Author | SHA1 | Message | Date |
---|---|---|---|
Erik Johnston |
1b238e8837
|
Speed up persisting large number of outliers (#16649)
Recalculating the roots tuple every iteration could be very expensive, so instead let's do a topological sort. |
7 months ago |
Eric Eastwood |
77156a4bc1
|
Process previously failed backfill events in the background (#15585)
Process previously failed backfill events in the background because they are bound to fail again and we don't need to waste time holding up the request for something that is bound to fail again. Fix https://github.com/matrix-org/synapse/issues/13623 Follow-up to https://github.com/matrix-org/synapse/issues/13621 and https://github.com/matrix-org/synapse/issues/13622 Part of making `/messages` faster: https://github.com/matrix-org/synapse/issues/13356 |
1 year ago |
Erik Johnston |
707d5e4e48
|
Encode JSON responses on a thread in C, mk2 (#10905)
Currently we use `JsonEncoder.iterencode` to write JSON responses, which ensures that we don't block the main reactor thread when encoding huge objects. The downside to this is that `iterencode` falls back to using a pure Python encoder that is *much* less efficient and can easily burn a lot of CPU for huge responses. To fix this, while still ensuring we don't block the reactor loop, we encode the JSON on a threadpool using the standard `JsonEncoder.encode` functions, which is backed by a C library. Doing so, however, requires `respond_with_json` to have access to the reactor, which it previously didn't. There are two ways of doing this: 1. threading through the reactor object, which is a bit fiddly as e.g. `DirectServeJsonResource` doesn't currently take a reactor, but is exposed to modules and so is a PITA to change; or 2. expose the reactor in `SynapseRequest`, which requires updating a bunch of servlet types. I went with the latter as that is just a mechanical change, and I think makes sense as a request already has a reactor associated with it (via its http channel). |
2 years ago |
Jonathan de Jong |
bdfde6dca1
|
Use inline type hints in `http/federation/`, `storage/` and `util/` (#10381) | 2 years ago |
Patrick Cloke |
7adcb20fc0
|
Add missing type hints to synapse.util (#9982) | 3 years ago |
Richard van der Hoff |
294c675033
|
Remove `synapse.types.Collection` (#9856)
This is no longer required, since we have dropped support for Python 3.5. |
3 years ago |
Jonathan de Jong |
4b965c862d
|
Remove redundant "coding: utf-8" lines (#9786)
Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>` |
3 years ago |
Eric Eastwood |
0a00b7ff14
|
Update black, and run auto formatting over the codebase (#9381)
- Update black version to the latest
- Run black auto formatting over the codebase
- Run autoformatting according to [`docs/code_style.md
`](
|
3 years ago |
Erik Johnston |
056327457f
|
Fix chain cover update to handle events with duplicate auth events (#9210) | 3 years ago |
Erik Johnston |
1a08e0cdab
|
Fix event chain bg update. (#9118)
We passed in a graph to `sorted_topologically` which didn't have an entry for each node (as we dropped nodes with no edges). |
3 years ago |
Erik Johnston |
1315a2e8be
|
Use a chain cover index to efficiently calculate auth chain difference (#8868) | 3 years ago |
Richard van der Hoff | acc7820574 |
Log saml assertions rather than the whole response
... since the whole response is huge. We even need to break up the assertions, since kibana otherwise truncates them. |
4 years ago |
Richard van der Hoff | 14d8f342d5 | move batch_iter to a separate module | 4 years ago |