emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PERFORMANCE] Why some org code is so deep invoked?


From: Ihor Radchenko
Subject: Re: [PERFORMANCE] Why some org code is so deep invoked?
Date: Fri, 12 Aug 2022 21:12:56 +0800

"Christopher M. Miles" <numbchild@gmail.com> writes:

>> I do not see much issue with deep nesting of the code.
>
> Is this deep nested code normal in Emacs Lisp?
>
> Usually (based on my less than 20 times profiling experience), Emacs
> wouldn't have deeper code than 40 levels. But my attachment profiler
> report has more than 100 levels.
>
> If this is normal and fine, It's OK. I repeat, I ask this question for
> curious purpose which want to get an answer for not important question.

It depends. You are looking at the complex code here, which is not
necessarily common.

However, lisp nesting is tangent to performance. Shallow nesting can be
slow while deep nesting can be fast. Or vice versa.

>> Could you please clarify what exactly is your problem?
>> Is agenda generation slow?
>
> From the profiler report, you can see that Agenda is slow on clock table
> generation because I have ~org-agenda-start-with-clockreport-mode~
> enabled. And this deep code invocation is from it too. It's about 5
> seconds to generate the org-agenda clock table. Actually I can tolerate
> this time, Just found this performance issue when profiling and curious
> to ask this question.

Note that your profiler result does not look like taken from a 5
second-lasting code:

         390  13%     - completing-read

Completing read takes >10% *CPU time* of the 5 seconds? Suspicious. I'd
retry to get the profile.

Also, I suggest to use M-x write-file in the profiler buffer when
sharing something as deeply nested as you got. The resulting file is
much more comfortable to view - it will preserve all the actual profiler
data.

I will refrain from trying to deduce anything from the profiler for now.

Please try to reproduce the report again and share it with us. Then, I
will try to see if we can do anything on the Org side.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



reply via email to

[Prev in Thread] Current Thread [Next in Thread]