From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Org-mode pcomplete is slow, affect performance Date: Sat, 05 May 2018 17:58:17 +0800 Message-ID: <87a7teifuu.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEtxY-0002cz-S7 for emacs-orgmode@gnu.org; Sat, 05 May 2018 05:58:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEtxV-0005rI-PV for emacs-orgmode@gnu.org; Sat, 05 May 2018 05:58:32 -0400 Received: from [183.249.134.109] (port=13828 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEtxU-0005mH-Re for emacs-orgmode@gnu.org; Sat, 05 May 2018 05:58:29 -0400 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: org-mode --=-=-= Content-Type: text/plain I use Emacs profiler profiled company-capf in Org-mode buffer. Here is an org-mode buffer test snippet (in a big Org file): #+begin_src clojure :results pp (nth '(1 2 3) 1) #+end_src Profiler result in attachments. It has very recursive deep file-truename invoking. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=profiler-cpu.txt + command-execute 4769 56% - company-post-command 1645 19% - company--perform 1555 18% - company--continue 1539 18% - company-calculate-candidates 1539 18% - company--postprocess-candidates 1536 18% - company--transform-candidates 1536 18% - company-sort-by-occurrence 1536 18% - cl-delete-if 1536 18% - apply 1536 18% - cl-delete 1536 18% - # 1536 18% - company--occurrence-predicate 1523 18% - company-call-backend 1519 17% - company--force-sync 1519 17% - apply 1519 17% - company-call-backend-raw 1519 17% - apply 1519 17% - company-capf 1516 17% - company--capf-data 1513 17% - company--capf-data-real 1513 17% - run-hook-wrapped 1513 17% - completion--capf-wrapper 1513 17% - pcomplete-completions-at-point 1510 17% - pcomplete-completions 1203 14% - pcomplete/org-mode/block-option/src 1160 13% - pcomplete--here 593 7% - file-truename 590 6% - file-truename 543 6% - file-truename 455 5% - file-truename 409 4% - file-truename 355 4% - file-truename 281 3% - file-truename 213 2% - file-truename 186 2% - file-truename 149 1% - file-truename 109 1% - file-truename 67 0% file-truename 25 0% + while 564 6% + pcomplete-parse-arguments 25 0% + org-command-at-point 18 0% + mapcar 283 3% + comint--unquote-argument 7 0% pcomplete--common-suffix 7 0% + derived-mode-p 4 0% + company--fetch-candidates 3 0% + company-call-frontends 16 0% + company-call-frontends 90 1% - ... 1451 17% - company-auto-begin 954 11% - company--perform 954 11% - company--begin-new 954 11% - company-call-backend 941 11% - company--force-sync 941 11% - apply 941 11% - company-call-backend-raw 941 11% - apply 941 11% - company-capf 941 11% - company--capf-data 938 11% - company--capf-data-real 938 11% - run-hook-wrapped 938 11% - completion--capf-wrapper 938 11% - pcomplete-completions-at-point 938 11% - mapcar 938 11% - # 938 11% - file-truename 938 11% - file-truename 932 11% - file-truename 929 10% - file-truename 782 9% - file-truename 648 7% - file-truename 542 6% - file-truename 446 5% - file-truename 347 4% - file-truename 264 3% - file-truename 163 1% - file-truename 86 1% file-truename 27 0% + company--capf-post-completion 3 0% + company-calculate-candidates 13 0% Automatic GC 497 5% + timer-event-handler 508 6% + redisplay_internal (C function) 83 0% --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=profiler-memory.txt - company-post-command 305,110,567 73% - company--perform 304,349,811 72% - company--continue 302,923,670 72% - company-calculate-candidates 201,401,680 48% - company--postprocess-candidates 199,844,422 47% - company--transform-candidates 199,844,422 47% - company-sort-by-occurrence 199,844,422 47% - cl-delete-if 199,840,286 47% - apply 199,840,286 47% - cl-delete 199,840,286 47% - # 199,840,286 47% - company--occurrence-predicate 199,836,150 47% - company-call-backend 199,836,150 47% - company--force-sync 199,836,150 47% - apply 199,836,150 47% - company-call-backend-raw 199,836,150 47% - apply 199,836,150 47% - company-capf 199,836,150 47% - company--capf-data 199,831,958 47% - company--capf-data-real 199,831,958 47% - run-hook-wrapped 199,815,414 47% - completion--capf-wrapper 199,815,414 47% - pcomplete-completions-at-point 199,786,614 47% + mapcar 100,343,364 24% - pcomplete-completions 99,171,770 23% - pcomplete/org-mode/block-option/src 99,010,502 23% - while 81,666,454 19% - pcomplete--here 81,666,454 19% - file-truename 81,659,118 19% - file-truename 63,667,594 15% + file-truename 43,576,958 10% - pcomplete--here 17,344,048 4% file-truename 17,245,596 4% + pcomplete-parse-arguments 116,924 0% + org-command-at-point 40,152 0% completion-table-with-quoting 49,632 0% completion-table-subvert 45,496 0% + comint--unquote-argument 27,720 0% pcomplete--common-suffix 4,096 0% + company--fetch-candidates 1,557,258 0% - company-call-backend 101,521,990 24% - company--force-sync 101,521,990 24% - apply 101,521,990 24% - company-call-backend-raw 101,521,990 24% - apply 101,521,990 24% - company-capf 101,521,990 24% - company--capf-data 101,521,990 24% - company--capf-data-real 101,521,990 24% - run-hook-wrapped 101,521,990 24% - completion--capf-wrapper 101,521,990 24% - pcomplete-completions-at-point 101,521,990 24% - mapcar 56,819,836 13% - # 56,819,836 13% - file-truename 56,789,116 13% - file-truename 56,387,986 13% - file-truename 56,108,958 13% - file-truename 46,490,968 11% - file-truename 37,198,576 8% - file-truename 27,718,886 6% - file-truename 18,284,816 4% file-truename 9,083,978 2% - pcomplete-completions 44,694,946 10% - pcomplete/org-mode/block-option/src 44,694,946 10% - pcomplete--here 44,694,946 10% - file-truename 44,694,946 10% - file-truename 44,422,884 10% - file-truename 23,766,500 5% - file-truename 18,916,088 4% - file-truename 14,263,716 3% - file-truename 9,433,980 2% file-truename 4,710,460 1% completion-table-with-quoting 4,136 0% - comint--unquote-argument 3,072 0% comint--unquote&requote-argument 3,072 0% + company-call-frontends 1,426,141 0% + company-call-frontends 760,756 0% - command-execute 101,160,160 24% - call-interactively 101,160,160 24% - funcall-interactively 101,160,160 24% - company-complete-selection 53,635,376 12% - company-finish 53,635,376 12% - company-cancel 53,632,280 12% - company-call-backend 53,623,992 12% - company--force-sync 53,623,992 12% - apply 53,623,992 12% - company-call-backend-raw 53,623,992 12% - apply 53,623,992 12% - company-capf 53,623,992 12% - company--capf-post-completion 53,623,992 12% - company--capf-data 53,623,992 12% - company--capf-data-real 53,623,992 12% - run-hook-wrapped 53,623,992 12% - completion--capf-wrapper 53,623,992 12% - pcomplete-completions-at-point 53,623,992 12% - mapcar 32,465,144 7% - # 32,465,144 7% - file-truename 32,454,904 7% - file-truename 32,321,194 7% - file-truename 32,228,534 7% - file-truename 32,205,548 7% - file-truename 32,184,684 7% - file-truename 32,163,846 7% - file-truename 32,143,068 7% - file-truename 32,121,310 7% - file-truename 32,092,476 7% - file-truename 22,937,860 5% + file-truename 13,578,400 3% + pcomplete-completions 21,157,824 5% + comint--unquote-argument 1,024 0% + run-hook-with-args 8,288 0% + company--insert-candidate 3,096 0% + counsel-M-x 41,932,566 10% + save-buffer 5,471,224 1% + org-self-insert-command 75,512 0% + org-kill-line 45,482 0% + redisplay_internal (C function) 5,544,422 1% + timer-event-handler 5,009,470 1% + yas--post-command-handler 107,984 0% + winner-save-old-configurations 12,408 0% beacon--vanish 8,192 0% + xselect-convert-to-string 2,176 0% + sclang-document-post-command-hook-function 2,048 0% ... 0 0% --=-=-= Content-Type: text/plain -- [ stardiviner ] don't need to convince with trends. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-=--