coldnew / pangu-spacing

emacs minor-mode to add space between Chinese/Japanese/Korean and English characters.
144 stars 16 forks source link

Performance Issue #24

Open coldnew opened 6 years ago

coldnew commented 6 years ago

see: https://emacs-china.org/t/topic/4043 https://emacs-china.org/t/topic/3816

AmanYang commented 6 years ago

Hello cloldnew, When enabling global-pangu-spacing-mode', I cannot open large files. The emacs process will be stuck inpangu-spacing-check-overlay'. Is there any way to avoid this?

coldnew commented 6 years ago

@AmanYang Can you tell me how large the file you open with ?

I think the problem is due to when open file, pangu-spacing-mode will search from (point-min) to (point-max), which as known as the buffer size (file size).

To solve this issue, I should limit pangu-spacing-mode not search full file but just search user's view area instead.

AmanYang commented 6 years ago

When the size of file is larger than 1M, can see obviously slow. When larger than 10M, completely frozen.

yangsheng6810 commented 5 years ago

@AmanYang Could you try #28 to see if it works for you?

AmanYang commented 5 years ago

@yangsheng6810 Yes. It works for me after a tiny change. I got a compile error after applying your path. pangu-spacing.el:218:1:Error: Wrong number of arguments: #[(beg end func regexp) " Found that in pangu-spacing-check-overlay, the 2nd pangu-spacing-search-overlay took 2 arguments instead of 4.