r/vim • • 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

25 Upvotes

12 comments sorted by

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.

1

u/toon_link_776 14d ago edited 14d ago

Yep, that's what I like about it! But I'm on relatively old hardware(T530), and I tend to have lots of windows open (2-3 c projects at a time + browser) and I noticed all of that start to add up. It might be nemo or xed which were causing the issue, and I'd guess that gvim is more efficient than xed? So I was wondering if gvim & xed were comparable. Might be best to slim down on simultaneous nemo instances, or convert from that to terminal as well. but its so nice to have nemo's autocomplete to navigate folders...

Edit: Adding Thunar actually seems to help, its pretty quick. I might consider just moving to xfce entirely, but i like cinnamon's tiled window mangement a lot...

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.

1

u/toon_link_776 14d ago

True, but I'm on old hardware with lots of windows open in multiple projects. I'm on a T530(2013) with 12 GB DDR3. The slowdowns weren't awful, but they were there.

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.

1

u/toon_link_776 14d ago

yeah I was just thinking that, just replaced gnome-terminal with xfce4-terminal. going to see how that does and try to use less nemo & more terminal for file management i think. maybe find something a little lighter than nemo

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.

1

u/toon_link_776 14d ago

thats true, I was just looking to see what peoples experiences are in how differently they operate so I could make the decision. but honestly I don't really think I'd need gvim anyways cause I don't really even like using the mouse haha

2

u/ReallyEvilRob 14d ago

I don't touch the mouse. I mainly installed the gvim package since that is the one my distro compiles with x11 clipboard support.

2

u/toon_link_776 14d ago

oh my god yeah I might use it just for that reason too. There might be some kind of terminal extension for it or something but I think that's the only gripe I've had so far

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

1

u/toon_link_776 14d ago

That's what I'd figured, but I was doubtful because it's not as if terminal isn't essentially a gui program given that its an emulated terminal thats running in xwindow or wayland or whatever(if I'm understanding the way that terminals are integrated into the OS properly). I guess what I'd need to really figure out is if there's a more minimal terminal application I could use on mint. also I've been putting off looking into tmux but I think its about time.