benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
400 stars 29 forks source link

vr is extermely slow in Windows7 #52

Open pavlo-alkhimov opened 7 years ago

pavlo-alkhimov commented 7 years ago

Using profiler-start/profiler-report I figured out, that visual-regexp is very slow in Windows. In Linux this problem is not available. GNU Emacs 25.3.1 (x86_64-w64-mingw32) of 2017-09-12 visual-regexp 20161017.1713 from elpa

benma commented 7 years ago

vr starts a Python process for every keystroke, maybe Windows is less efficient with that? Maybe a long running Python process could be used instead.

Happy for anyone using Windows to analyze this and make a PR. Sorry I can't be of more help, I don't have access to any Windows machine.

pavlo-alkhimov commented 7 years ago

For those who are interested: http://python.readthedocs.io/en/v2.7.2/faq/windows.html#why-does-python-sometimes-take-so-long-to-start It seems to be exactly my case as I use a company PC which checks if every executed program is permitted to run or not.

net commented 6 years ago

Only visual-regexp-steroids.el starts Python, correct?

Should these hooks be added when vr is entered and removed when it is ended?

https://github.com/benma/visual-regexp.el/blob/b3096c2d391ff4e28a2a4e8cd82efbf11071ea85/visual-regexp.el#L455 https://github.com/benma/visual-regexp.el/blob/b3096c2d391ff4e28a2a4e8cd82efbf11071ea85/visual-regexp.el#L463

benma commented 6 years ago

Yes, correct.

The hooks don't do anything when vr is not used actively, so it shouldn't be noticeable.

benma commented 5 years ago

Should these hooks be added when vr is entered and removed when it is ended?

Finally done in https://github.com/benma/visual-regexp.el/commit/3e3ed81a3cbadef1f1f4cb16f9112a58641d70ca