|
From: | JD Smith |
Subject: | Re: Mitigating the long-lines penalty in vundo |
Date: | Sat, 16 Dec 2023 17:00:36 -0500 |
GitHub shenanigans I guess. Stephen’s link works: https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00448.html.
I tried again from a clean session with eval-buffer’d vundo.el. The profiler for 10,000 edits (no undos) reports a very odd result: 1799 95% - command-execute 1799 95% - call-interactively 1799 95% - funcall-interactively 1799 95% - eval-_expression_ 1799 95% - eval 1799 95% - save-current-buffer 1797 95% - vundo 1797 95% - let 1756 93% - vundo-1 1756 93% - save-current-buffer 1756 93% - let 1756 93% - save-current-buffer 1756 93% - vundo--refresh-buffer 1756 93% - save-current-buffer 1756 93% - let 1651 87% - if 1649 87% - vundo--draw-tree 1649 87% - let* 1649 87% - while 1649 87% - let* 1640 86% - let 1560 82% - max 1560 82% 1- 71 3% - if 71 3% - let 71 3% - if 65 3% + insert 9 0% - rx-to-string 7 0% + rx--translate 1 0% + cons 2 0% + if 1 0% + progn 1 0% vundo--put-node-at-point 1 0% vundo--node-timestamp 2 0% + eq 105 5% + let* 41 2% + let 87 4% + ... Looking closer, the only relevant thing in draw-tree is (1- (current-column)). Adding that to my elp list and... we have found the principal culprit (here with 10K edits):
`current-column’ is apparently pretty expensive here (~1ms). The current-column docs do say:
I just tested it in a temp buffer with width 10K, and it’s much less expensive (60-100µs). Perhaps the text properties on each node character (containing the defstruct node object) slows current-column down even further. So it is a long-lines problem of a sort, just not display related.
Thank for the suggestions. I deeply appreciate all you do for Emacs and am honestly quite blown away by your responsiveness to bugs, queries, long bike-shed discussions, etc. Please take my comment only as gentle feedback on communication & perceptions, which I always appreciate receiving. Your advice was, as usual, good... now to workaround current-column slowness. Thanks again. |
[Prev in Thread] | Current Thread | [Next in Thread] |