Big files and logs

ted is built to open big files without making you wait. These are its numbers on a 100 MB log, on a laptop with an Intel Core i5-1235U.

WhatTime
First screen, from opening the file77 ms
The whole file loaded, in the background146 ms
Painting a frame while scrollingabout 1 ms
Painting a keystrokeabout 2 ms
Counting every match of a searchabout 30 ms

How it works

  • A file of 8 MB or more shows its first 256 KB at once, read only, while the rest loads. The gutter already has room for every line, so nothing jumps when the whole text arrives, and editing starts then.
  • Only the lines on screen are laid out and painted. A very long line, such as a minified JSON, is laid out only around the columns on screen.
  • The text lives in a rope, so an edit in the middle of a 100 MB file costs about the same as at its end.
  • Searching, highlighting and saving run in the background.

Opening the 100 MB log adds about 110 MB of memory to the window, the size of the file plus the index of its lines.

Found a mistake? Edit this page on GitHub or open an issue.

↑↓to move ↵to open /or Ctrl Kto search from any page