Matt Price <mopto...@gmail.com> writes:

> However, if I instead use my fairly extensive main config, latency is high
> enough that there's a noticeable delay while typing ordinary words. I see
> this  regardless of whether I build from main or from Ihor's org-fold
> feature branch on github. The profiler overview here is pretty different --
> redisplay_internal takes a much higher percentage of the CPU requirement:
>
>          3170  56% - redisplay_internal (C function)
> ....
>         1200  21%    - completing-read-default
>         1200  21%     - apply
>         1200  21%      - vertico--advice
>          475   8%       + #<subr completing-read-default>

Judging from the profiler report, you did not collect enough number of
CPU samples. I recommend to keep the profiler running for at least 10-30
seconds when trying to profile typing latency. Also, note that running
M-x profiler-report second time will _not_ reproduce the previous
report, but instead show CPU profiler report between the last invocation
of profiler-report and the second one. I recommend to do the following:
1. M-x profiler-stop
2. M-x profiler-start
3. Do typing in the problematic Org file for 10-30 seconds
4. M-x profiler-report (once!)
5. Share the report here

> I've almost never used the profiler and am not quite sure how I should
> proceed to debug this.  I realize I can comment out parts of the config one
> at a time, but that is not so easy for me to do in my current setup, and I
> suppose there are likely to be multiple contributing causes, which I may
> not really notice except in the aggregate.

The above steps should be the first thing to try and they will likely
reveal the bottleneck. If not, you can go back to genetic bisection. I
do not recommend manual commenting/uncommenting parts of you large
config. Instead, you can try
https://github.com/Malabarba/elisp-bug-hunter. But only if CPU profiling
does not reveal anything useful.

Best,
Ihor

Reply via email to