This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Commit c4fa4f3
authored
Fix perf of fetching the same events many times. (#10703)
The code to deduplicate repeated fetches of the same set of events was
N^2 (over the number of events requested), which could lead to a process
being completely wedged.
The main fix is to deduplicate the returned deferreds so we only await
on a deferred once rather than many times. Seperately, when handling the
returned events from the defrered we only add the events we care about
to the event map to be returned (so that we don't pay the price of
inserting extraneous events into the dict).1 parent 1800aab commit c4fa4f3
File tree
2 files changed
+24
-6
lines changed- changelog.d
- synapse/storage/databases/main
2 files changed
+24
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
523 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
524 | 533 | | |
525 | 534 | | |
526 | 535 | | |
527 | 536 | | |
528 | 537 | | |
529 | 538 | | |
530 | | - | |
| 539 | + | |
| 540 | + | |
531 | 541 | | |
532 | | - | |
| 542 | + | |
533 | 543 | | |
534 | 544 | | |
535 | 545 | | |
| |||
569 | 579 | | |
570 | 580 | | |
571 | 581 | | |
572 | | - | |
| 582 | + | |
573 | 583 | | |
574 | 584 | | |
575 | 585 | | |
576 | 586 | | |
577 | | - | |
| 587 | + | |
578 | 588 | | |
579 | 589 | | |
580 | 590 | | |
581 | 591 | | |
582 | 592 | | |
583 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
584 | 601 | | |
585 | 602 | | |
586 | 603 | | |
| |||
0 commit comments