From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#15841: Display bugs with cache-long-lines non-nil Date: Mon, 11 Nov 2013 18:23:10 +0200 Message-ID: <83li0u3o29.fsf@gnu.org> References: <871u2xf9st.fsf@gmail.com> <9jiow9uhoa.fsf@fencepost.gnu.org> <87wqkopylw.fsf@gmail.com> <87bo20fh3h.fsf@web.de> <834n7q95d5.fsf@gnu.org> <87r4aqww3j.fsf@nbtrap.com> <83r4aq3s4r.fsf@gnu.org> <83ppqa3rim.fsf@gnu.org> <87eh6o6rvm.fsf@web.de> <83y54w2jo1.fsf@gnu.org> <87li0vppwz.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1384187061 10002 80.91.229.3 (11 Nov 2013 16:24:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Nov 2013 16:24:21 +0000 (UTC) Cc: 15841@debbugs.gnu.org, nbtrap@nbtrap.com To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 11 17:24:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VfuHh-0006UK-4G for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Nov 2013 17:24:17 +0100 Original-Received: from localhost ([::1]:38056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfuHg-00030X-Nd for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Nov 2013 11:24:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfuHY-0002wZ-IJ for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 11:24:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfuHT-0003qc-6W for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 11:24:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfuHT-0003qY-3b for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 11:24:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VfuHS-0003Lj-Ea for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2013 11:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Nov 2013 16:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15841 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15841-submit@debbugs.gnu.org id=B15841.138418700812826 (code B ref 15841); Mon, 11 Nov 2013 16:24:02 +0000 Original-Received: (at 15841) by debbugs.gnu.org; 11 Nov 2013 16:23:28 +0000 Original-Received: from localhost ([127.0.0.1]:47202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VfuGt-0003Ko-NP for submit@debbugs.gnu.org; Mon, 11 Nov 2013 11:23:28 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:52796) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VfuGo-0003KW-L6 for 15841@debbugs.gnu.org; Mon, 11 Nov 2013 11:23:26 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MW300A00XGIK700@a-mtaout23.012.net.il> for 15841@debbugs.gnu.org; Mon, 11 Nov 2013 18:23:15 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MW300A5NXIRJW10@a-mtaout23.012.net.il>; Mon, 11 Nov 2013 18:23:15 +0200 (IST) In-reply-to: <87li0vppwz.fsf@web.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80268 Archived-At: > From: Michael Heerdegen > Cc: 15841@debbugs.gnu.org, nbtrap@nbtrap.com > Date: Mon, 11 Nov 2013 04:39:56 +0100 > > The culprit was my own code: it placed myriads of invisible overlays > with no properties into the buffer. Under these extreme circumstances, > `line-number-at-pos' indeed gets extremely slow at the end of my 10000 > lines buffer: one invocation needs over a second. I saw that with elp > as well as with profiler. Setting `cache-long-scans' to nil (or > removing the overlays) cures this. Can you show some simple enough code that puts so many overlays, and has this effect? It sounds like some optimization is in order. > Although this is a corner case, I wonder why overlays slow down > `line-number-at-pos' so much for `cache-long-scans' non-nil - is that > expected? I don't know. Armed with a simple test case, I will look into this and see what I find. > Because, when I use this: > > (defmacro my-measure-time (expr) > "Eval EXPR, display how much time it took." > (with-gensyms (time) > `(let ((,time (current-time))) > ,expr > (message "%s secs" > (float-time (time-subtract (current-time) ,time)))))) > > and evaluate (my-measure-time (line-number-at-pos)) manually with M-: > (in the same situation), it shows a very tiny value. But I'm sure that > from code, `line-number-at-pos' really lasts over a second. Strange, I > don't understand it. Redisplay is indeed a likely suspect, but still cache-long-scans somehow comes into play. Thanks.