Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Optimize DisplayLayer's memory usage by storing transformations in a Patch #185
A major issue with Atom's current handling of large files is that the
The reason that the
Translating between arbitrary buffer and screen coordinates is an important responsibility of the DisplayLayer, but many of the transformations listed above do not affect position translation. The only transformations that do affect position translation are soft-wraps, folds, and hard-tabs.
This PR takes advantage of that fact by avoiding storing any of the other transformations, and computing them only as needed, when rendering lines of text. This means that the data stored by the DisplayLayer is now sparse with respect to screen lines; nothing needs to be stored for screen lines without folds, soft-wraps or hard tabs.
We now store the
As part of this effort, we have rewritten the Patch in C++ and with a more compact representation, in order to further reduce Atom's memory consumption when editing large files.