unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Aborting display.  Is this possible?
Date: Tue, 21 Oct 2014 10:58:25 +0000	[thread overview]
Message-ID: <20141021105825.GA3035@acm.acm> (raw)
In-Reply-To: <87y4s9rgi9.fsf@fencepost.gnu.org>

Hello, David.

On Tue, Oct 21, 2014 at 10:09:18AM +0200, David Kastrup wrote:
> Alan Mackenzie <acm@muc.de> 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	other threads:[~2014-10-21 10:58 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 14:17 Aborting display. Is this possible? Alan Mackenzie
2014-10-19 14:32 ` David Kastrup
2014-10-19 14:54   ` Eli Zaretskii
2014-10-19 14:50 ` Eli Zaretskii
2014-10-19 15:42   ` Alan Mackenzie
2014-10-19 18:09     ` Eli Zaretskii
2014-10-20 11:09       ` Alan Mackenzie
2014-10-20 11:30         ` David Kastrup
2014-10-20 12:00           ` Alan Mackenzie
2014-10-20 15:15             ` Eli Zaretskii
2014-10-20 15:12         ` Eli Zaretskii
2014-10-20 16:56           ` Stefan Monnier
2014-10-20 17:10             ` Eli Zaretskii
2014-10-20 17:40               ` Eli Zaretskii
2014-10-20 18:57           ` Alan Mackenzie
2014-10-20 19:24             ` Eli Zaretskii
2014-10-20 21:08               ` Alan Mackenzie
2014-10-21  8:09                 ` David Kastrup
2014-10-21 10:58                   ` Alan Mackenzie [this message]
2014-10-21 11:04                     ` David Kastrup
2014-10-21 14:25                       ` Stefan Monnier
2014-10-21 14:01                   ` Stefan Monnier
2014-10-21 15:35                     ` Eli Zaretskii
2014-10-21 16:27                       ` Stefan Monnier
2014-10-22 18:28                         ` Stephen Leake
2014-10-22 20:10                           ` Stefan Monnier
2014-10-21 17:14                       ` Alan Mackenzie
2014-10-21 18:00                         ` Eli Zaretskii
2014-10-21 18:38                           ` Alan Mackenzie
2014-10-21 18:43                             ` Eli Zaretskii
2014-10-21 19:42                               ` Eli Zaretskii
2014-10-26 12:43                             ` Unfreezing the display during auto-repeated scrolling. [ Was: Aborting display. Is this possible? ] Alan Mackenzie
2014-10-26 16:45                               ` Eli Zaretskii
2014-10-26 20:03                                 ` Alan Mackenzie
2014-10-26 20:20                                   ` Eli Zaretskii
2014-10-26 20:42                                   ` Stefan Monnier
2014-10-26 22:15                                     ` Unfreezing the display during auto-repeated scrolling Alan Mackenzie
2014-10-27  1:03                                       ` Stefan Monnier
2014-10-27 14:28                                         ` Unfreezing the display during auto-repeated scrolling. Simpler approach Alan Mackenzie
2014-10-27 16:51                                           ` Eli Zaretskii
2014-10-27 19:13                                             ` David Engster
2014-10-27 19:26                                               ` Eli Zaretskii
2014-10-27 19:36                                                 ` David Engster
2014-10-27 19:38                                             ` Alan Mackenzie
2014-10-27 21:38                                               ` Stefan Monnier
2014-10-28 18:10                                                 ` Alan Mackenzie
2014-10-29  0:57                                                   ` Stefan Monnier
2014-10-29 14:14                                                     ` Eli Zaretskii
2014-10-29 14:52                                                       ` Alan Mackenzie
2014-10-29 15:37                                                         ` Eli Zaretskii
2014-10-29 16:59                                                         ` Stefan Monnier
2014-10-29 21:25                                                           ` Alan Mackenzie
2014-10-30  1:49                                                             ` Stefan Monnier
2014-10-30 22:09                                                               ` Alan Mackenzie
2014-10-31  3:06                                                                 ` Stefan Monnier
2014-10-31  7:55                                                                   ` Eli Zaretskii
2014-10-31 14:04                                                                     ` Stefan Monnier
2014-11-21 15:44                                                                       ` Alan Mackenzie
2014-11-23  9:51                                                                         ` Tassilo Horn
2014-11-23 10:40                                                                           ` Alan Mackenzie
2014-11-23 19:44                                                                             ` Tassilo Horn
2014-11-23 22:04                                                                               ` Alan Mackenzie
2014-11-24 11:34                                                                                 ` Tassilo Horn
2014-11-24 11:53                                                                                   ` David Kastrup
2014-11-24 16:00                                                                                     ` Alan Mackenzie
2014-11-24 14:37                                                                                 ` Stefan Monnier
2014-11-24 16:08                                                                                   ` Alan Mackenzie
2014-11-24 17:44                                                                                     ` Stefan Monnier
2014-10-27  3:36                                       ` Unfreezing the display during auto-repeated scrolling Eli Zaretskii
2014-10-27 10:05                                         ` Alan Mackenzie
2014-10-27 16:48                                           ` Eli Zaretskii
2014-10-27 22:46                                             ` Alan Mackenzie
2014-10-28  0:22                                               ` Stefan Monnier
2014-10-27  3:33                                     ` Unfreezing the display during auto-repeated scrolling. [ Was: Aborting display. Is this possible? ] Eli Zaretskii
2014-10-21 18:01                         ` Aborting display. Is this possible? Stefan Monnier
2014-10-21 15:40                 ` Eli Zaretskii
2014-10-21 17:00                 ` Michael Welsh Duggan
2014-10-21 18:25                   ` Alan Mackenzie
2014-10-20  1:59     ` Stefan Monnier
2014-10-20  2:45       ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2014-10-20 17:18 grischka
2014-10-20 17:23 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141021105825.GA3035@acm.acm \
    --to=acm@muc.de \
    --cc=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).