all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Jörg Walter" <jwalt@garni.ch>
Cc: 12463@debbugs.gnu.org
Subject: bug#12463: 24.2; pos-visible-in-window-p gets slower over time
Date: Tue, 18 Sep 2012 13:23:30 +0300	[thread overview]
Message-ID: <83fw6f1vfh.fsf@gnu.org> (raw)
In-Reply-To: <5511358.p8J1TLefsG@queen>

> From: Jörg Walter <jwalt@garni.ch>
> Date: Tue, 18 Sep 2012 11:46:13 +0200
> 
> > Jörg, does this happen with earlier versions of Emacs, like 24.1 or
> > 23.3?
> 
> I've done some additional tests: It does *not* happen with Ubuntu's emacs23 
> (23.3.1). Just for cross-checking, I ran Win32 emacs 24.2 once via wine and 
> once in VirtualBox+WinXP, in both cases no bug.
> 
> It *does* happen with Ubuntu's emacs24 (24.1.1), which is where I first noticed 
> the problem. It also happens on all  X toolkits (gtk, gtk3, athena, lucid).

Thanks.

Would it be possible for you to time the related code on the C level,
and find which part(s) are responsible for the slow-down?

To do that, insert into the C code calls to a function that returns
some measure of time before and after the code fragment being timed,
and print the difference between two successive calls if that
difference exceeds some threshold.  For example:

  double
  timer_time (void)
  {
    struct timeval tv;

    gettimeofday (&tv, NULL);
    return tv.tv_usec * 0.000001 + tv.tv_sec;
  }
  [...]
    double t1, t2;
    extern double timer_time (void);
    [...]
    t1 = timer_time ();
    /* Some code being timed.  */
    t2 = timer_time ();
    if (t2 - t1 >= 0.001)  /* show time from 1 msec and up */
      {
	fprintf (stderr, "foo took %.4g sec\n", t2 - t1);
	fflush (stderr);
      }

The code in question is Fpos_visible_in_window_p itself, and its main
subroutine, pos_visible_p.  The latter is a large function, so if it
is the culprit, successively dividing it into smaller pieces by
bisection will allow you to show what part is taking the most time.

If you can do the above, the first thing to establish is whether
timing the whole of Fpos_visible_in_window_p on the C level shows
approximately the same times and exhibits the same growth trend as
what 'benchmark' shows on the Lisp level.  If it doesn't show the same
timings, then the code which implements pos-visible-in-window-p is not
the issue, and we should look elsewhere for the explanations.

Also, if you repeat the benchmark after terminating it, do the numbers
start from the last (longest) measurement or from the first
(shortest), or somewhere in between?  IOW, do you need to restart
Emacs to reset the measurements back to the first shortest value?

Thanks.






  reply	other threads:[~2012-09-18 10:23 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 23:51 bug#12463: 24.2; pos-visible-in-window-p gets slower over time Jörg Walter
2012-09-18  7:46 ` Eli Zaretskii
2012-09-18  9:46   ` Jörg Walter
2012-09-18 10:23     ` Eli Zaretskii [this message]
2012-09-18 15:05     ` Matt Lundin
2012-09-18 16:24       ` Eli Zaretskii
2012-09-18 15:17   ` Chong Yidong
2012-09-18 16:18     ` Jörg Walter
2012-09-20 23:22       ` Juanma Barranquero
2012-09-21  3:52         ` Chong Yidong
2012-09-21  5:42           ` Chong Yidong
2012-09-21  7:34             ` Eli Zaretskii
2012-09-21  9:24               ` Chong Yidong
2012-09-21 10:47                 ` Juanma Barranquero
2012-09-21 12:33                   ` Eli Zaretskii
2012-09-21 16:38                     ` Stefan Monnier
2012-09-21 16:58                       ` Eli Zaretskii
2012-09-21 20:34                         ` Stefan Monnier
2012-09-22  6:58                           ` Eli Zaretskii
2012-09-22 20:20                             ` Stefan Monnier
2012-09-22 20:31                               ` Juanma Barranquero
2012-09-23  9:17                                 ` Chong Yidong
2012-09-23  3:50                               ` Eli Zaretskii
2012-09-21  9:10             ` Juanma Barranquero
2012-09-21 10:01               ` Chong Yidong
2012-09-21 17:03                 ` Eli Zaretskii
2012-09-21 17:07                   ` Juanma Barranquero
2012-09-21 17:45                     ` Eli Zaretskii
2012-09-22  1:23                       ` Chong Yidong
2012-09-22  8:36                         ` Eli Zaretskii
2012-09-22 11:05                           ` Chong Yidong
2012-09-22 11:18                             ` Eli Zaretskii
2012-09-22 14:14                               ` Chong Yidong
2012-09-22 14:25                                 ` Eli Zaretskii
2012-09-22 19:20                                 ` Juanma Barranquero
2012-09-22 19:46                                   ` Eli Zaretskii
2012-09-22 19:53                                     ` Juanma Barranquero
2012-09-23  3:48                                       ` Eli Zaretskii
2012-09-21  6:58           ` Eli Zaretskii
2012-09-21  8:36           ` Juanma Barranquero
2012-09-21  9:11             ` Chong Yidong
2012-09-21  9:17               ` Juanma Barranquero
2012-09-18 16:19     ` Eli Zaretskii
2012-09-18 16:26       ` Jörg Walter
2012-09-18 17:19         ` Eli Zaretskii
2012-09-18 17:31           ` Juanma Barranquero
2012-09-18 20:00             ` Eli Zaretskii
2012-09-19  2:31               ` Juanma Barranquero
2012-09-19  2:57                 ` Eli Zaretskii
2012-09-19  3:03                   ` Juanma Barranquero

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

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

  git send-email \
    --in-reply-to=83fw6f1vfh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12463@debbugs.gnu.org \
    --cc=jwalt@garni.ch \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.