Subject: bug#78766: 100-4000x redisplay slowdown with vscroll>0 and make-cursor-line-fully-visible=t

From: JD Smith <[email-masked]>
Date: Fri, 13 Jun 2025 10:07:05 -0400

Quick followup.  I was able to instrument the single function `set_iterator_to_next' to track total call count and distribution of call times of this core function.  Since the instrumentation slowed the test down so much, I profiled moving (forward-char) by just 3 chars with redisplay in a partially visible top line, using the slow setting of make-cursor-line-fully-visible=t.  

The total call count per character moved in the slow case is enormous: >800K.

I compared this against the fast case in which make-cursor-line-fully-visible=nil.  Here I moved 56 * 20 iterations = 1,120 chars.  You can see the call count is much, much smaller (although with similar run times per function call):

I.e. about 280 calls per char moved.  In both cases the time series of calls looks fairly normal: