|
| From: | Christopher Miles |
| Subject: | Is it possible to optimize Org Mode org-activate-links ? |
| Date: | Sat, 13 Feb 2021 01:10:28 +0000 |
<#secure method=pgpmime mode=sign>
I did an profiler (with my extension "org-link-beautify").
Here is the result of (Memory and CPU).
I checked org-element-context source code, it's not so long and complex. Why it caused so many items in Memory profiler result? Is it possible to optimize it?
Here is the Emacs profiler (CPU) result:
8 2% - org-activate-links8 2% - catch8 2% - while6 2% - let*6 2% - if6 2% - progn6 2% - let*5 1% - let5 1% - if5 1% - progn5 1% - funcall5 1% - org-link-beautify-display2 0% - org-link-beautify--return-icon2 0% org-link-beautify--warning2 0% file-name-extension1 0% - org-link-beautify--preview-pdf1 0% - org-link-beautify--display-thumbnail1 0% - create-image1 0% - apply1 0% - #<compiled 0x4c76891e673d173>1 0% - image-type1 0% - image-type-from-file-header1 0% generate-new-buffer1 0% - let*1 0% - cond1 0% - or1 0% facep
Here is the Emacs profiler (Memory) result:
1,939,896 11% - org-activate-links1,939,896 11% - catch1,939,896 11% - while1,761,816 10% - let*1,761,816 10% - if1,697,400 9% - progn1,658,488 9% - let*1,511,048 8% - let1,511,048 8% - if1,511,048 8% - progn1,511,048 8% - funcall1,511,048 8% - org-link-beautify-display947,000 5% - org-link-beautify--get-element947,000 5% - org-element-context947,000 5% - catch947,000 5% - save-excursion947,000 5% - save-restriction947,000 5% - let*792,384 4% - let792,384 4% - catch792,384 4% - while792,384 4% - let792,384 4% - org-element--object-lex792,384 4% - if792,384 4% - let*792,384 4% - save-excursion792,384 4% - while661,368 3% - let655,272 3% - setq655,272 3% - cond655,272 3% - let*655,272 3% - cond610,224 3% - let*610,224 3% - cond610,224 3% - if610,224 3% - progn610,224 3% - org-element-link-parser610,224 3% - catch610,224 3% - let450,480 2% - cond225,240 1% - setq225,240 1% - org-link-expand-abbrev139,248 0% - org-link-unescape131,064 0% - replace-regexp-in-string8,184 0% apply85,992 0% - if77,808 0% not8,184 0% - let*8,184 0% and163,800 0% - cond61,440 0% or8,184 0% setq159,744 0% - if98,304 0% - progn49,152 0% if49,152 0% - setq49,152 0% replace-regexp-in-string45,048 0% - and45,048 0% - org-element-link-parser45,048 0% - catch45,048 0% - let32,760 0% cond12,288 0% if131,016 0% and154,616 0% - or154,616 0% - org-element-at-point154,616 0% - save-excursion154,616 0% - save-restriction154,616 0% - let154,616 0% - cond79,864 0% - progn79,864 0% - let*71,680 0% - org-at-heading-p71,680 0% outline-on-heading-p74,752 0% - org-element--parse-to74,752 0% - catch74,752 0% - save-excursion74,752 0% - save-restriction74,752 0% - let*74,752 0% - cond74,752 0% - if74,752 0% - progn74,752 0% - let*74,752 0% outline-previous-heading368,568 2% - file-name-extension36,864 0% file-name-sans-versions133,272 0% - org-link-beautify--preview-pdf109,788 0% - org-link-beautify--display-thumbnail107,898 0% - create-image107,898 0% - apply107,898 0% - #<compiled 0x4c76891e673d173>107,898 0% - image-type107,898 0% - image-type-from-file-header63,048 0% insert-file-contents-literally32,760 0% image-type-from-buffer126 0% generate-new-buffer22,512 0% - org-link-unescape22,512 0% - replace-regexp-in-string16,368 0% apply22,352 0% org-link-beautify--display-icon9,216 0% - org-link-beautify--return-icon8,184 0% org-link-beautify--warning139,256 0% - save-excursion139,256 0% - let139,256 0% - unwind-protect139,256 0% - progn139,256 0% - org-element-link-parser139,256 0% - catch139,256 0% - let103,416 0% - cond50,168 0% - setq50,168 0% - org-link-expand-abbrev34,808 0% - org-link-unescape26,624 0% replace-regexp-in-string15,360 0% - if15,360 0% not30,720 0% - cond15,360 0% or35,840 0% - if18,432 0% - progn9,216 0% if9,216 0% - setq9,216 0% replace-regexp-in-string8,184 0% - list8,184 0% - let*8,184 0% if38,912 0% - let38,912 0% + let*64,416 0% + and
ATT00001.txt
Description: ATT00001.txt
| [Prev in Thread] | Current Thread | [Next in Thread] |