r/vim • u/toon_link_776 • 15d ago
Discussion Vim Terminal vs Graphical in terms of resource usage
Hello, I've been using xed in Linux Mint as a C editor, and I've recently started using terminal vim instead to increase efficiency. It's really nice! I was wondering whether vim terminal used less resources than its gui counterpart. I'm assuming the answer is yes given vim & gvim would probably be mostly the same thing other than whatever graphical work gvim is doing. I use workspaces heavily with mint on a T530, so a lot of times I have multiple projects open and eventually the text editors add up. I think I'll just have to experiment, but does anyone have any experience in the difference between the two and how significant it is?
Update: Installed xfce4-terminal, using it with vim. has a little less memory usage compared to xed(26 mb vs 18 mb), but gvim & vim appear to literally be exactly the same. both 18mb. I've already kinda gotten used to terminal vim but i guess I can use gvim now too! I guess vim just has the advantage of not having as many dependencies and such. Also, I installed thunar and its much more responsive than nemo was. at this rate I'll have to consider reinstalling & switching to xfce entirely maybe, but if everything works then it works as a side note I'll probably also be using shell scripts to open my project windows to save time & thunar and also tmux
22
u/-romainl- The Patient Vimmer 15d ago
GVim is not a massive web-based monstrosity like VSCode. It is a very conservative program that uses native toolkits in a very boring way. You may notice small difference in performance between Vim in your terminal emulator and GVim (scrolling, typing…) but you won't notice anything resource-wise.
FWIW, an idle MacVim instance (GVim tailored for macOS) uses 0 CPU cycles, 5 threads and about 60Mb of memory. Each new buffer basically adds the size of the file on disk plus a little overhead to the memory usage. That's nothing.
For comparison, this Chrome tab uses 431Mb of memory.
6
u/digitaljestin 15d ago edited 15d ago
I don't actually know, but I can't imagine the difference is significant by today's standards. Worry more about what your plugins are using.
4
u/gmes78 14d ago
It's not "terminal Vim" vs GVim, it's "terminal emulator + terminal Vim" vs GVim.
You have a GUI either way. GVim is probably technically more efficient, but I don't think you'll notice a difference.
6
u/ReallyEvilRob 15d ago
I think you're just splitting hairs here. Using a terminal editor will most likely be lighter on resources than the GUI counterpart, but that's not the only thing contributing to efficiency. If the GUI environment helps you do your work as efficiently as possible, then use the GUI. For me, gvim fits my workflow nicely.
5
u/scythe-3 15d ago
Terminal is always going to be faster at rendering text than GUI. The difference in speed is likely negligible in a direct 1-to-1 comparison; but I would imagine that having 3-4 terminal windows open is significantly lighter on resources than 3-4 GUI apps.
You can use also use a multiplexer (e.g. tmux) to manage multiple vim sessions from a single terminal window, which cuts down on resource usage even more.
Imo I don't see much of a use for gvim except maybe one-off quick edits. Terminal vim is much more flexible for project workflows, and the terminal itself is a powerhouse once you become familiar with it