From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Beck Subject: Re: [PATCH] Fix massive slowdown in org-id-find Date: Tue, 24 Mar 2015 23:49:54 +0100 Message-ID: <87twxarox9.fsf@sophokles.streitblatt.de> References: <87bnjj2565.fsf@sophokles.streitblatt.de> <87vbhrnz07.fsf@nicolasgoaziou.fr> <877fu6u03n.fsf@sophokles.streitblatt.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaXed-0000Ta-Cm for emacs-orgmode@gnu.org; Tue, 24 Mar 2015 18:50:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaXeY-0001xq-CP for emacs-orgmode@gnu.org; Tue, 24 Mar 2015 18:50:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:50092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaXeY-0001xH-56 for emacs-orgmode@gnu.org; Tue, 24 Mar 2015 18:50:30 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YaXeV-0003Am-5S for emacs-orgmode@gnu.org; Tue, 24 Mar 2015 23:50:27 +0100 Received: from ip-77-24-163-174.web.vodafone.de ([77.24.163.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Mar 2015 23:50:27 +0100 Received: from fb by ip-77-24-163-174.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Mar 2015 23:50:27 +0100 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-orgmode@gnu.org >> Could you profile it? Here are the results: With my setup and the patch I get, using (let ((time (current-time))) (org-id-find "zangwill.nick_2014:aesthetic.judgment") (format "%ss" (time-to-seconds (time-subtract (current-time) time)))) --> "0.027756516s" Without my patch, the result is --> "16.104403749s" profile-report returns: - command-execute 16095 99% - call-interactively 16095 99% - funcall-interactively 15905 98% - eval-last-sexp 15879 98% - elisp--eval-last-sexp 15879 98% - eval 15879 98% - let 15879 98% - org-id-find 15879 98% - org-id-find-id-in-file 15879 98% - org-find-entry-with-id 15879 98% - org-find-property 15879 98% - save-excursion 15879 98% - let 15879 98% - catch 15879 98% - while 15879 98% - if 13311 82% - if 13311 82% - equal 13311 82% - org-entry-get 11955 74% - org-get-property-block 8876 55% - org-inlinetask-in-task-p 3329 20% org-inlinetask-outline-regexp 12 0% - org-back-to-heading 3009 18% - outline-back-to-heading 2000 12% outline-on-heading-p 4 0% org-before-first-heading-p 880 5% org-get-limited-outline-regexp 24 0% - # 939 5% match-string-no-properties 44 0% - execute-extended-command 20 0% - sit-for 16 0% redisplay 16 0% + command-execute 4 0% + previous-line 6 0% + byte-code 190 1% + timer-event-handler 15 0% + ... 0 0% -- Florian Beck