Commit 9bee6d1
committed
Optimize diff-hl--update
This adds optimizations to the buffer traversal and overlay application logic:
- Cache the boolean state of (or changes ref-changes) into a local
variable 'has-changes' outside the loop to prevent the Lisp
interpreter from recalculating it for all active buffers.
- Bind inhibit-redisplay to t during the resolution callback to prevent
the display engine from rendering intermediate UI states during
asynchronous overlay updates.
- Conditionally execute diff-hl--update-overlays only when 'changes' or
'ref-changes' are non-nil, avoiding unnecessary function calls.1 parent 81b7628 commit 9bee6d1
1 file changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
| 744 | + | |
| 745 | + | |
745 | 746 | | |
746 | 747 | | |
747 | | - | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
750 | 750 | | |
| 751 | + | |
751 | 752 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
761 | 763 | | |
762 | 764 | | |
763 | 765 | | |
| |||
0 commit comments