On Dec 4, 2022, at 4:12 AM, Eli Qian <eli.q.qian@gmail.com> wrote:

After investigation by using profiler, I found the problem is caused by
`org-element-at-point`

I'm also seeing this slowdown after compliling from Emacs master around the time of the 29.1 cutoff. I use the org version in Emacs master. I use clocktable reports that scope a two week period to calculate the time spent on tasks. Normally the update to the table takes maybe 10s-30s, but lately it takes over 3 minutes to run.

Emacs 30.0.50 (Build 21G115) of 2022-12-02
Org mode version release_9.6-3-ga4d38e @ /Applications/Emacs.app/Contents/Resources/lisp/org/
Emacs  -Q
Open org file with clocking data and find the clocktable line as shown below. C-c C-c to update the clocktable report.

#+BEGIN: clocktable :scope file :maxlevel 6 :link nil :tstart "[2022-11-19 Sat 00:00]" :tend "[2022-12-03 Sat 11:00]" :formula % :step day :stepskip0 t

This took over 3 minutes to run.

If I use an older build I have as my "stable" version for testing...
Emacs 29.0.50 (Build 21F79) of 2022-08-05
Org mode version 9.5.4-17-g6e991f 
then the same clocktable line takes 11s to update.

Mark