From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Stefan-W. Hahn" Subject: Bug?: Performance problem when loading file Date: Fri, 7 Oct 2016 15:49:36 +0200 Message-ID: <20161007134936.GB6719@seven> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsVkE-00075O-5Q for emacs-orgmode@gnu.org; Fri, 07 Oct 2016 10:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsVk9-0007MZ-Vt for emacs-orgmode@gnu.org; Fri, 07 Oct 2016 10:03:25 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:62910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsVk9-0007M6-MB for emacs-orgmode@gnu.org; Fri, 07 Oct 2016 10:03:21 -0400 Content-Disposition: inline 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" To: emacs-orgmode@gnu.org Cc: Nicolas Goaziou Hello, I'm using Org-mode version 8.3.4 (release_8.3.4-1034-gadcaf9 @ /home/hs/.emacs.d/git/org-mode/lisp/) on emacs 25.1/25.2. With this version (also newer versions) I have a problem with loading files. I normally switch all files with extensions ".org" and also ".txt" to org-mode, even if the files are not a normal org file. This was no problem in the past. The problem happens on Linux and also on Windows (but more slow then on Linux). With current version it is a performance problem if the file contains following lines: 1111111111.222222 3 [xxxxxx_xxx]<0xffff> <<>> XX X XXXX XX XXXX XX->XX Data(hex): ff => 04 The content is from a log file and the problematic content is the "<<>>" part. (If I change the "<<<", ">>>" to "<<", ">>" the loading time in org-mode is ok.) If I have a file with around 160 lines as above and switch this file from fundamental-mode to org-mode it costs several seconds. A file with around 400K containing much of this lines costs minutes. I made an elp-instrumented measurement and the problematic part seems to be org-element-object-lex which called around 25760 times for the 160 lines file. With a bigger file it is much more. org-mode 1 1.089653152 1.089653152 org-update-radio-target-regexp 1 1.073683384 1.073683384 org-element-context 160 1.071594578 0.0066974661 org-element--object-lex 25760 0.9774005559 3.794...e-05 org-element-radio-target-parser 12880 0.2644946760 2.053...e-05 org-element-subscript-parser 12880 0.1016634290 7.893...e-06 org-element-link-parser 12880 0.0978871550 7.599...e-06 org-element-verbatim-parser 12720 0.0708337510 5.568...e-06 org-element-at-point 160 0.0616519250 0.0003853245 org-element--parse-to 160 0.0577311660 0.0003608197 org-element--current-element 160 0.0327868739 0.0002049179 org-element-paragraph-parser 160 0.0264464149 0.0001652900 org-element-timestamp-parser 12880 0.0113777200 8.833...e-07 org-mode-reftex-setup 1 0.005703614 0.005703614 .. Question: Is there a bug in org-element or is this behaviour intended? With kind regards, Stefan -- Stefan-W. Hahn It is easy to make things. It is hard to make things simple.