News for hackers. Stuff that matters.
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by lysace on Saturday October 12, 2024 @06:16PM (#41823197)
I'm confused. On the modern devices I've recently used emacs on (including very low-powered raspberry pi devices), all of your three criteria are already true.

What kind of HW are you running emacs on where this isn't the case?

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by musicale on Saturday October 12, 2024 @06:45PM (#41823383)
This is from 2015, but emacs still has higher typing latency than vim in 2024.

https://pavelfatin.com/typing-with-pleasure/

If you have better numbers and comparisons for emacs keypress-to-pixel latency, etc. I'd be interested.

Note classic vi started up faster than vim.

Device makes little to no difference: Raspberry Pi 5, MacBook Pro M1, ThinkPad P1, etc. - emacs is clunky on all of them. I like emacs and it's my daily driver. But it isn't fast.

see also:

"Computer latency: 1997-2017" https://danluu.com/input-lag/

"Measuring keyboard-to-photon latency with a light sensor" https://thume.ca/2020/05/20/making-a-latency-tester/

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by znpy on Sunday October 13, 2024 @05:11AM (#41826381)
I have often see some fellow coworkers start up their fairly complex vim/neovim/other-vim setups and quite frankly… they ended up recreating a poor emacs implementation.

Yeah it’s faster at starting up but it’s worse in pretty much everything else.

Oh and they end up typing Ctrl-this Ctrl-that anyway.

Might as well use gnu emacs.

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by arghnoname on Saturday October 12, 2024 @06:27PM (#41823267)
Emacs pauses are almost always due to some operation blocking in the main thread. It's pretty annoying and is mostly a consequence to a lot of things effectively being single-threaded. Stock emacs doesn't do this very often, but third party packages that might do expensive tasks often do
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by lysace on Saturday October 12, 2024 @06:30PM (#41823282)
Ah. A case of "don't do that, then".
Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by iLemming on Monday October 14, 2024 @12:10AM (#41834090)
a) Build it with native-compilation flag

b) Use https://github.com/blahgeek/emacs-lsp-booster

c) Tweak GC vars, see: https://emacs-lsp.github.io/lsp-mode/page/performance/

d) Use plists for deserialization (described in the previous link)

e) Learn how to use built-in profiler and don't hesitate to launch it, sometimes simply disabling some minor-mode in specific setting is all it takes

f) Current state of Tree-sitter in Emacs is a mixed bag - for some modes you get huge improvements, for others it's the opposite. YMMV.

Re:Ask HN: If you were rewriting Emacs from scratch, what wo... by hollerith on Saturday October 12, 2024 @08:48PM (#41824170)
Receiving output from a process, as is done for example by shell mode and (I guess, but have not verified) compilation mode, is slow in Emacs because all output is run through comint-carriage-motion and ansi-color-filter-region (which does nothing but throw color information away IIRC) which are written in Elisp.

If you don't run the output through those 2 functions, then non-printing characters remain in the output that severely undermine legibility.

C programmers tend to develop the ability to glean information from the voluminous output of build processes as it goes whizzing by on a terminal, so they find compilation mode frustratingly slow. Or at least that is my guess as to what happens.