Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [performance]

is for Emacs performance-related issues. Use additional tags to indicate which aspects of Emacs the performance issue is about: startup, navigation, search, screen updates, compilation, execution, debugging, and so on.

Filter by
Sorted by
Tagged with
72
votes
10answers
9k views

How do I prevent extremely long lines making Emacs slow?

I see hugely varied performance depending on how many newlines there are in the file I'm visiting. Here's an example. I have two JSON files: $ wget https://github.com/Wilfred/ReVo-utilities/blob/...
40
votes
1answer
14k views

How can I troubleshoot a very slow Emacs?

I am writing a document and I have a problem with Emacs' performance that I think appeared just yesterday. I haven't made any alterations in my init file or installed any new packages. The problem is ...
40
votes
3answers
3k views

What can I do to speed up my start-up?

What are some basic things I could do to reduce the start-up time? Is there anything in particular I should pay attention to, for that matter? Note: Startup time can be mitigated by starting Emacs ...
31
votes
3answers
2k views

Why is `let' faster with lexical scope?

While reading through the source code for the dolist macro, I ran into the following comment. ;; This is not a reliable test, but it does not matter because both semantics are acceptable, tho one ...
26
votes
4answers
2k views

How do I measure performance of elisp code?

How do I measure the performance of my elisp code? What tools / external packages are available for me to measure time taken? In addition to total time, can I see a profile that shows time taken per-...
24
votes
1answer
2k views

What algorithm does sort use?

I need to add a single integer to a list that's already sorted, such that it goes in the right place. My first tought was something like (sort (cons newelt list) #'<) However, given that list is ...
19
votes
2answers
2k views

How can I improve startup time despite many packages?

TL;DR I have such a huge amount of packages that it's hurting my startup time. If you don't believe that could be the case, read on. My Emacs startup time is quite small. I don't use use-package, I ...
16
votes
1answer
2k views

Is there any downside to setting `gc-cons-threshold` very high and collecting garbage when idle?

I added the following two lines to the top of my init.el: (setq gc-cons-threshold (eval-when-compile (* 1024 1024 1024))) (run-with-idle-timer 2 t (lambda () (garbage-collect))) That means that ...
14
votes
2answers
2k views

How to prevent slow-down when an inferior processes generates long lines?

I use Emacs with Geiser to hack on some Scheme code. As I'm playing around in the REPL I sometimes evaluate expressions that result in a lot of output, often all on one line. For example, I just ...
14
votes
2answers
4k views

Magit extremely slow in Windows. How do I optimize?

I am forced to use Windows 10 for a project. Yes, I would rather use GNU/Linux. To keep my sanity, I've tried to regard Windows as a bootloader for Emacs :) Unfortunately, Magit (one of my favorite ...
13
votes
2answers
2k views

practical limits on org-mode file size?

I have an org-mode file that's running around 6,000 lines with a hundred or so top-level headlines. It's started to take around a minute to load or save, and occasionally it sends emacs into the weeds ...
13
votes
1answer
1k views

Optimizing font lock performance

I want to perform a variant of anchored font lock matching. I have function definitions that start with a list of names, and I want those names to be highlighted inside the function body. I have ...
10
votes
1answer
192 views

Are there any pre-existing benchmark suites for Emacs itself?

(This question is not about writing benchmarks/profiling elisp code, for that, see this question.) Do any benchmark suites exist for Emacs performance? I'm looking for something equivalent to the V8 ...
9
votes
1answer
647 views

unicode.txt slowness

Moving around point (using the cursor keys) in Xah’s unicode.txt in fundamental-mode is noticeably slower than in an ordinary text file. Are the many non-ASCII characters the issue? Anything else? ...
9
votes
1answer
458 views

`looking-back` performance

I have some code using (looking-back … (line-beginning-position)). Doc string of looking-back states that it's better to avoid this function because of slowness. I'm curious will following approach ...
8
votes
2answers
1k views

org-babel result to a separate buffer

I use org-babel to generate some reports which can't be automatically processed, and since org is a good outline format, I print the results in org to represent them as trees. I've noticed that ...
8
votes
3answers
2k views

Emacs on Windows 7 very slow when computer is outside company network

I'm using GNU Emacs 24.3 on Windows 7 and normally I don't have any problems with speed/responsiveness. I'm launching Emacs with runemacs.exe However, when I am travelling and try to connect to my ...
8
votes
1answer
280 views

Speed up org-map-entries when matching by property

Question: Why is org-map-entries property matching so slow, and what can I do to speed it up? Background: I have a relatively simple use for org-map-entries: grab the effort (in integer minutes) from ...
8
votes
1answer
1k views

“Making tag completion table” Freezes/Blocks — how to disable

TLDR: I've got a large tags file that loads multiple times per session, making it unusable. Can't find the source of issue or how to disable it -- main goal is to jump to tags, but completion would ...
7
votes
3answers
801 views

How to avoid scrolling with large files hanging for short periods of time? (holding page keys for example)

Even using default settings (emacs -Q) I've found large C files can be slow to scroll with Emacs. If for example, I open a large file and hold Page-Down. It will scroll down 1-2 pages, then hang for ...
6
votes
4answers
2k views

Speed up Emacs start-up time

I have seen this thread but my problem is an order of magnitude larger. Also, a newbie, I did not understand much of what was being discussed there. So, this new question. I am running Emacs 25.2.2 ...
6
votes
1answer
328 views

What are the advantages of building Emacs from source?

I use precompiled Emacs binaries (24.3) right now. AFAIK, v24.4 is already available as binaries, so there is no incentive for me to compile Emacs myself to stay current. I'm thinking, however, ...
6
votes
0answers
732 views

How to find what causes ESS to run very slow?

When working with an iESS session of R and an R file open side-by-side, I noticed extremely slow performance when typing indetifiers. Typing braces and operators is fine, however, when an identifier ...
5
votes
0answers
447 views

Ways to make Emacs feel snappy as Vim? [closed]

When I switched to Emacs from Vim, I really loved the extensibility of Emacs. But compared with Vim, Emacs still feels somewhat sluggish. Especially when I moved my pointer/cursor around, and typing ...
4
votes
2answers
64 views

How to pipe large files through fold before opening?

On a regular basis I need to open files that have really long lines, which unfortunately causes emacs to grind to a halt. My understanding is that this is a long-term issue with the renderer. I've ...
4
votes
1answer
302 views

How do I stop Emacs micro-stuttering and high CPU utilization caused by background calls to git?

Using Emacs on Windows, I experiences issues due to background invocations of git.exe. The same issues might apply on Linux, though the more light-weight process calling might make them unnoticable. ...
4
votes
1answer
645 views

is 64 bit Windows actually faster?

Installing Windows 64 bit for Windows 7 is currently a massive pain Where is official 64-bit Emacs for Windows? (The manual said there is!) because although there are many roque cuts, GNU are not ...
4
votes
2answers
68 views

avoid emacs to lock down or crash when used for many tasks

I consider to start using emacs for IRC, SQL, Shell and maybe twitter and Feed reading. But than I wonder how power users of emacs deal with emacs being single threaded. So if I have one long-running ...
4
votes
0answers
939 views

byte-compile much slower in X (vs. -nw)

Setup Windows 10 host with X server (VcXsrv) Linux guest (Arch) in virtual machine (VMware) Benchmark (defmacro measure-time (&rest body) "Measure the time it takes to evaluate BODY." `(let ...
3
votes
1answer
198 views

Debugging open file handles in emacs

Is there a way I can find what file handles emacs has open, and close these references? Or even better, find where they are being open? Emacs is keeping handles to a large number of files (a leak) ...
3
votes
2answers
261 views

How to eliminate excessive filesystem accesses that are slow over sshfs?

I am trying to make Emacs work faster over sshfs. It is currently quite slow in opening files, saving files, and sometimes when starting editing. I used sshfs's debugging mode to track the ...
3
votes
3answers
197 views

Emacs slows to a crawl when Chrome is running

Really bizarre issue here; I suspect it's X-related. This may be better suited to the Linux/Unix SE, but I figured there might be more domain-specific expertise here. Often (but not 100% of the time)...
3
votes
0answers
137 views

csv-mode is very slow

Just about any buffer with csv-mode enabled gets very slow/unresponsive, regardless of how big the file is. It takes up to half a second to jump to the next line/character. Any idea why that is? I ...
3
votes
0answers
126 views

Profiling org-mode init file

My initialization file is organized in org-mode with src snippets. Is there a way I can profile it to see which snippets take the most time to evaluate? When my initialization file was in Elisp, I was ...
2
votes
1answer
429 views

Magit commit is slow even for tiny changes

For the last few months, committing even tiny changes using magit (c c) is really slow to bring up the commit message buffer. I've profiled the code that is executing during that time but I'm not ...
2
votes
1answer
190 views

Setting faces is slow?

I'm seeing rather bizarre behavior. I have the following code: (defun set-mode-line-face () (let ((color (pcase (random 6) (`1 '("#586e75" . "#eee8d5")) (`2 '("#...
2
votes
1answer
43 views

Is it possible to disable magit calling :git branch --remote --contains <foo> when doing an interactive re-base?

I'm running on fairly large repository (Gentoo's portage, 2.5G .git) and slightly slow hardware (1Ghz arm64) and interactive re-basing is very slow. It seems the main culprit is "git branch --remote --...
2
votes
1answer
62 views

Magit hunk with long lines set default hidden

When I am using magit and open a a certain commit containing hunks with very long lines (a minified javascript file, css ...), emacs does not respond anymore or it becomes very slowly, luckily still ...
2
votes
2answers
555 views

Why emacs multiplication performance is so bad?

I compared two versions of loop in emacs and in C. Emacs byte-compiled version gives 4.5 seconds, C version gives 0.22 seconds. Why so slow? How to optimize it? Emacs version: ;; -*- lexical-...
2
votes
1answer
209 views

Size of process output sent to filter functions

I'm using comint to communicate with a REPL. From time to time the REPL sends large amounts of data. This causes a significant lag (about one second), because my filter function gets called on a ...
2
votes
1answer
63 views

Fastest way to draw pixels in Emacs

I'm currently working on a CHIP-8 emulator. This platform requires me to draw 64x32 black/white pixels, ideally at a speed between 30 and 60 frames per second. There's an extension to it that ...
2
votes
1answer
214 views

auto-complete mode performance is awful in nxml-mode

Performance used to be OK, but a couple of weeks ago the performance got much worse. Some experimentation showed that it's auto-complete-mode in XML files. When I type, it now takes a second or two ...
2
votes
0answers
198 views

Find cause of cpu-usage?

Is there some way to find out, what in Emacs is causing spurious cpu usage? Since a few days I notice Emacs retaining high CPU usage despite not being used actively, having no subprocesses, and not ...
2
votes
0answers
109 views

hide-show with linum

When working on huge files, it seems that when hide-show collapses a large multi-line block, linum still creates hidden overlays for every line in the hidden block leading to unresponsive emacs. Is ...
2
votes
0answers
65 views

how can I debug or fix slowness in org-cycle?

running org-cycle appears to hang sometimes. I've run M-x profiler-start <tab> ;; bound to org-cycle C-g ;; to cancel apparently-hung command M-x profiler-report and I see that a bunch of time ...
1
vote
1answer
62 views

Installation of Org-ref slows down start-up

I am super new to Emacs. I just followed the installation section of org-ref. I managed to get a simple citation working by adding bibliographystyle:plain to the file. This is one of the solution one ...
1
vote
2answers
67 views

When local variables are “calculated”?

Does elisp calculate values of local variables at declaration or when calling them? Say i want to find out what headlines in buffer are lvl2, and do stuff to them: (defun map-org-heads () (org-...
1
vote
1answer
112 views

Cancel printing of long string in buffer

Sometimes when in e.g. a Python or SQL buffer I accidentally evaluate something that outputs e.g. multiple megabytes of text into the buffer. >>> zps = _read_zipfile_container(br.response()....
1
vote
2answers
327 views

s3fs is too slow for emacs

I have set up a mount point using the s3fs FUSE filesystem and autofs to talk to an Amazon S3 bucket, but it is excruciatingly slow to edit a file in the bucket in emacs - it is basically unusable due ...
1
vote
0answers
61 views

Performantly filter against a custom time-like property

My agenda view processes many items with SCHEDULED and DEADLINE fields, and fully generates from scratch in about 0.3s. However, if I append CUSTOM_SCHEDULED<"<now>" to my agenda view ...