I had an e-mail with Anders Lindgren and asked for help to improve the situation on the performance, his words were the following:
After looking at the code, the big problem with it is that it doesn't respect the search limit. The background is that font-lock only highlights parts of a buffer at a time. When editing, this typically is only the line where the editing takes place. (You can use my package highlight-refontification to visualize this.) In your code, the limit is incorrectly named _start-pos and never used, with the effect that it searches outside the region that is being updated, which could be very expensive for large buffers.
Fixing only this has already big improvements on the performance.
I also removed the save-excursion call, because it is unnecessary.
test cases are all still passing, and editing gl.nim is possible again.
fix for #198
I had an e-mail with Anders Lindgren and asked for help to improve the situation on the performance, his words were the following:
Fixing only this has already big improvements on the performance.
I also removed the
save-excursion
call, because it is unnecessary.test cases are all still passing, and editing
gl.nim
is possible again.