Optimize diff-hl--update#283
Conversation
92b5fa0 to
f95dbef
Compare
|
This adds two optimizations during the buffer traversal. First, Second, the boolean state of |
f95dbef to
8e0ef6d
Compare
8e0ef6d to
67eecb0
Compare
67eecb0 to
8f484d7
Compare
|
Hi! I like the The other two seem negligible: considering we save the We could also drop the |
e6d15fd to
0c9cdb3
Compare
|
That makes perfect sense. I have updated the pull request to preserve the diff-hl--target-buffer abstraction and dropped the redundant buffer-live-p checks inside the loop. |
3366d5a to
7908fbe
Compare
|
I also set inhibit-redisplay to t during the resolution callback to prevent the display engine from rendering intermediate UI states during asynchronous overlay updates. Because the function recreates a large number of overlays across multiple buffers, the Emacs display engine can waste CPU cycles recalculating display properties, margins, or fringe bitmaps before the buffer state is completely finalized. |
7908fbe to
44d996b
Compare
44d996b to
81b7628
Compare
Please drop the Regarding Redisplay happens at specific points of the event loop, not right after any change in a buffer. |
9bee6d1 to
4449f16
Compare
|
I have removed the 'or' and |
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.
4449f16 to
8fe215f
Compare
|
Thanks! |
|
You're very welcome! |
This pull request optimizes
diff-hl--update.