From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: [bug] canonical context not work in 8.3 Date: Fri, 7 Aug 2015 13:27:37 -0700 Message-ID: References: <87mvy4eywo.fsf@nicolasgoaziou.fr> <8737zvfpvc.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNoEu-0007s1-Jc for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 16:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNoEt-0001EH-C9 for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 16:27:40 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:37490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNoEt-0001ED-0S for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 16:27:39 -0400 Received: by wibhh20 with SMTP id hh20so79652296wib.0 for ; Fri, 07 Aug 2015 13:27:38 -0700 (PDT) In-Reply-To: <8737zvfpvc.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: Samuel Wales , emacs-orgmode thank you. i compiled it and tried it. it seems improved, to maybe 2.5s. - command-execute 17977 99% - call-interactively 17977 99% - org-agenda-switch-to 16144 88% - org-show-context 16142 88% - org-show-set-visibility 16142 88% - show-children 16042 88% - org-map-region 15617 86% - # 6905 38% org-outline-level 1780 9% - outline-flag-region 12 0% remove-overlays 4 0% outline-next-heading 4381 24% org-end-of-subtree 401 2% org-up-heading-safe 72 0% - org-show-entry 16 0% + byte-code 16 0% + org-flag-heading 4 0% org-mark-ring-push 2 0% - # 1189 6% - org-agenda 1189 6% - byte-code 1189 6% - org-let 1189 6% - eval 1189 6% - let 1189 6% - org-agenda-list 1189 6% - byte-code 1185 6% - org-agenda-prepare 625 3% - org-agenda-prepare-buffers 618 3% - byte-code 618 3% + org-refresh-category-properties 262 1% + org-refresh-stats-properties 184 1% + org-set-regexps-and-options 40 0% + org-refresh-effort-properties 36 0% org-refresh-properties 32 0% + byte-code 440 2% + org-agenda-finalize-entries 104 0% + org-agenda-finalize 8 0% - org-agenda-next-line 287 1% - org-agenda-do-context-action 273 1% - org-display-outline-path 273 1% + org-get-outline-path 241 1% + org-unlogged-message 24 0% + org-format-outline-path 8 0% + call-interactively 13 0% + ido-hacks-execute-extended-command 189 1% On 8/7/15, Nicolas Goaziou wrote: > Samuel Wales writes: > >> thank you for fixing. >> >> canonical is always what i want, except for occur-tree. >> >> i did profiler-start then went to org file a few times to average out >> the results. did i use the correct profiler? > > You did. >> >> command-execute 60148 99% >> - call-interactively 60148 >> 99% >> - org-agenda-switch-to 59299 >> 98% >> - org-show-context 59299 >> 98% >> - org-show-set-visibility 59299 >> 98% >> - show-children 59170 >> 97% >> - outline-end-of-subtree 35938 >> 59% >> outline-next-heading 9399 >> 15% >> org-outline-level 4047 >> 6% >> - outline-map-region 23168 >> 38% >> + # 9558 >> 15% >> outline-next-heading 7399 >> 12% >> + org-up-heading-safe 117 >> 0% >> + org-show-entry 4 >> 0% >> + org-flag-heading 4 >> 0% > > `show-children' is the culprit. > > Could you evaluate the following function and time it again? > > (defun show-children (&optional level) > (save-excursion > (org-back-to-heading t) > (let* ((current-level (funcall outline-level)) > (level (if level (+ (prefix-numeric-value level) > current-level) > (save-excursion > (outline-next-heading) > (if (eobp) current-level (funcall > outline-level)))))) > (org-map-region > (lambda () > (when (<= (funcall outline-level) level) > (outline-flag-region (if (bobp) (point) (1- (point))) > (line-end-position) > nil))) > (point) > (org-end-of-subtree t t))))) > > Thank you. > > > Regards, > -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com Ramsay's disease DOES progress. MANY people have died from it. And ANYBODY can get it. Denmark: free Karina Hansen NOW.