emacs-php / emacs-php/php-mode

Pasting lines is slow in large files

Open
#543 6 comments 0 reactions 1 assignee Claimed by @zonuexe View on GitHub
Performance
Dominant language
Emacs Lisp
Stars
602
Forks
117
Avg merge
12h 54m
Merged PRs (30d)
3

Description

1. Take any sufficiently big PHP file ([slightly exaggerated example file](https://p.teknik.io/K1GuH)).
2. Open it in php-mode.
3. Copy any line or block of code (even an empty line).
4. Paste it. It's going to be noticeably slow.
If running on a supercomputer, spam that paste chord a bit (the pastes will queue, it will take a while).
Undoing the operations will be similarly slow.

The slowness is increased the bigger the file.

![emacs profile](https://u.teknik.io/mPmo9.png)

It seems like the culprit is https://github.com/emacs-php/php-mode/blob/c53e0c1ec154fcfe6e5db56d1513d503a62e0355/php-mode.el#L954
Notice there are no heredocs at all in the file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.