From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: Possible cache problems Date: Tue, 2 Jun 2015 23:21:11 +0200 Message-ID: <20150602212111.GA3455@chitra.no-ip.org> References: <20150602170921.GF2027@chitra.no-ip.org> <87d21dsvox.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yztcd-0007m1-Rb for emacs-orgmode@gnu.org; Tue, 02 Jun 2015 17:21:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YztcY-0007dE-S1 for emacs-orgmode@gnu.org; Tue, 02 Jun 2015 17:21:19 -0400 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:35712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YztcY-0007d9-MI for emacs-orgmode@gnu.org; Tue, 02 Jun 2015 17:21:14 -0400 Received: by wgme6 with SMTP id e6so150570383wgm.2 for ; Tue, 02 Jun 2015 14:21:14 -0700 (PDT) Received: from chitra.no-ip.org (ip82-139-115-46.lijbrandt.net. [82.139.115.46]) by mx.google.com with ESMTPSA id uc9sm28657643wjc.7.2015.06.02.14.21.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jun 2015 14:21:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87d21dsvox.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Emacs Org mode Hi Nicolas, On Tue, Jun 02, 2015 at 10:26:54PM +0200, Nicolas Goaziou wrote: > Hello, > > Suvayu Ali writes: > > > I have been noticing a strange heisenbug. From time to time, Org starts > > eating CPU for certain specific tasks: org-end-of-line, fill-paragraph, > > folding or unfolding trees, or adding/changing properties with > > org-set-property. However these happen only after I have been using Org > > for a while. > > This is typical for cache breakage. Okay, good that it is not as mysterious as I was thinking :). > > I think I also see similar CPU eating symptoms when I have buffers > > editing version controlled files. I have auto-revert-mode enabled for > > files under version control, I think that is related. I'm not entirely > > sure though, I don't know how to narrow it down either. > > > > I say it is cache related since all this magically goes away, once I go > > to the top of my current tree, and call org-element-cache-reset. > > However, once the symptoms start showing, it happens more frequently > > despite my cache resets. > > Usually, a cache breakage is a specific action applied to some specific > document structure that induces an incorrect computation of the parts of > the cache to clear and to update. > > If you encountered the problem, it means the problematic document > structure is already in the current buffer. So, the chances are high > that you will repeat the problematic editing action on it again, even > after resetting the cache. IOW, all the ingredients are there for the > problem to repeat again and again. > > Finding the problematic action is not easy. I wrote a basic minor mode > (element-debug-mode) for that: after each change to the buffer, it > checks if the cache and pending updates match the parse tree. It sends > a message anytime they differ, which happens as soon as a problematic > action was triggered. I have enabled the mode on my document. Let's see how this goes. Btw, since you warn against large documents, would it help if I narrowed a large document before enabling the mode? Thanks a lot :). -- Suvayu Open source is the future. It sets us free.