3

I'm curious about the Emacs architecture. Do you know where are the structures for keeping opened text file? Where are the main functions for opening, editing and closing text files? How in general terms text is stored.

I once opened one xml file, which was 100 MiB large and had only two lines of text. Then I typed a character in the large one, emacs stopped reacting for a several minutes with a 100% cpu usage. So, I guess, emacs did kept that 100 MiB line as a single memory block, and moved 99.999999 of them to the right then this happened. I'm curious where exactly in the code this happened, what's the file name + function name.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • It is very likely that the performance problem is caused by `font-lock`. Try `M-x fundamental-mode` and type again a character. – Tobias Dec 26 '15 at 19:03
  • @Tobias huh, that did speed up things quite a lot, thanks. (And I probably mistaken there, it waits only for 5 seconds instead of 5 minutes. Or maybe I changed something since then and forgot about it. Doesn't matter, thanks) – Peret Finctor Dec 26 '15 at 19:19
  • 2
    "100 MiB large and had only two lines of text" - see https://emacs.stackexchange.com/questions/598/how-do-i-prevent-extremely-long-lines-making-emacs-slow and [Emacs bug#13675](http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13675). Also see [`(elisp) Buffer Gap`](http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Gap.html) – npostavs Dec 26 '15 at 19:50

0 Answers0