emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aborting display. Is this possible?


From: Alan Mackenzie
Subject: Re: Aborting display. Is this possible?
Date: Tue, 21 Oct 2014 10:58:25 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, David.

On Tue, Oct 21, 2014 at 10:09:18AM +0200, David Kastrup wrote:
> Alan Mackenzie <address@hidden> writes:

> > I'd posit that the absolute correctness isn't all that important after an
> > auto-repeating PageDown.

> That would mean that if you lean on PageDown, something catches your eye
> while leafing through, you stop and press PageUp a few times in order to
> locate it, it won't reappear where it caught your eye.

Yes, possibly.  That's if the "default" face used to calculate positions
and occupancy is grossly bigger or smaller than the typical face.  But
since you've stopped very soon after seeing FOO, the discrepancy
typically shouldn't be too large.  The other answer is that since in
this sort of scrolling only a small proportion of screens actually get
displayed (see below), the user will soon stop expecting to be able to
eyeball a passing function declaration.

At any rate, that situation would be an improvement on the current
arrangement, where leaning on PageDown (with font-lock enabled) leads to
a frozen screen, which stays frozen long after the key is released.

Should the region of the buffer already be fontified (or font-locking
disabled), the proposed new behaviour would be the same as the current.

I've done some more measurements on my system:

Autorepeat: delay between 1st event and 2nd event: 0.168s.
            delay between subsequent consecutive events: 0.024s.
Scrolling operation on non-fontified 65 line window with xdisp.c:
            mean time: 0.106s  standard deviation: 0.046s
Scrolling operation on already fontified 65 line window with xdisp.c:
            mean time: 0.011s  standard deviation: 0.0023s

By subtracting the above two, the mean time to fontify a screen is
0.095s, to display a fontified screen is 0.011s.

Assume that the time to calculate a scrolled position, without
fontification, is less than 0.011s.  Assume 0.010s.

So, by my new scheme, a typical timeline would be:

0.0s   Arrival of PageDown event   Event queue is empty, so start of
                                     fontification of screen 2.
0.095s                             Fontification done; start of display.
0.106s                             Display complete.  Queue is empty.

0.192s Arrival of PageDown event   Event queue is empty, so start of
                                     fontification of screen 3.
0.216s Arrival of PageDown event   Queued (1)
0.240s Arrival of PageDown event   Queued (2)
0.264s Arrival of PageDown event   Queued (3)
0.287s                             Fontification done; start of display
0.288s Arrival of PageDown event   Queued (4)
0.298s                             Display of screen 3 complete.  Start
                                     scroll command.  Queue is
                                     non-empty (3), so start calculating
                                     new position for screen 4 without
                                     fontification.
0.312s Arrival of PageDown event   Queued (4)                                
0.318s                             Finished calculation of screen 4's
                                     position.  Start scroll command.
                                     Queue is 3; start calculating new
                                     screen 5 position without
                                     fontification.
0.328s                             Finished calculation for scree 5.
                                     Queue is 2. Start calc for screen
                                     6.
0.336s Arrival of PageDown event   Queued (3)
0.338s                             Finished calc for screen 6.  Queue is
                                     2.  Start calc for screen 7.
0.348s                             Finished calc for screen 7.  Queue is
                                     1.  Start calc for screen 8.
0.358s                             Finished calc for screen 8.  Queue is
                                     empty.  Start fontification for
                                     screen 9.
                                   
0.360s Arrival of PageDown event   Queued (1)
0.384s Arrival of PageDown event   Queued (2)
0.408s Arrival of PageDown event   Queued (3)
0.432s Arrival of PageDown event   Queued (4)
0.453s                             Fontification of screen 9 done.
                                     Start displaying it.
0.456s Arrival of PageDown event   Queued (5)
0.464s                             Display of screen 9 complete.  Start
                                     scroll command.  Queue is 4, start
                                     calculating position for screen 10.
0.475s                             Finished calc for screen 10.  Queue
                                     is 3.  Start calc for screen 11.
0.480s Arrival of PageDown event   Queued (4)
0.486s                             Finished calc for screen 11.  Queue
                                     is 3.  Start calc for screen 12.
0.497s                             Finished calc for screen 12.  Queue
                                     is 2.  Start calc for screen 13.
0.504s Arrival of PageDown event   Queued (3)
0.508s                             Finished calc for screen 13.  Queue
                                     is 2.  Start calc for screen 14.
0.519s                             Finished calc for screen 14.  Queue
                                     is 1.  Start calc for screen 15.
0.528s Arrival of PageDown event   Queued (2)
0.530s                             Finished calc for screen 15.  Queue
                                     is 1.  Start calc for screen 16.
0.541s                             Finished calc for screen 16.  Queue
                                     is empty.  Start fontification for
                                     screen 17.
...
0.636s                             Finished fontifying of screen 17.
                                     Start displaying it.
...
0.647s                             Display of screen 17 complete.

------------------------------------------------------------------------

So it would appear in a worst case scenario (xdisp.c in a 65 line
window), about 5 screens per second would be displayed, approximately
every 8 screens.

> -- David Kastrup

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]