nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

How much processing power does OS use when in use?

Mon Feb 23, 2015 11:11 pm

Hi,

Ive had the raspberry pi model B and now I have my Pi2, and have never found the answer to this question.

How much processing power does the OS use, when it's being used?

When I say this I'm referring to when you type in startx, and it takes you to the GUI, vs staying at the command line style, and running applications from there. If someone could give me just an estimate such as 10%, 30%, ect... or something of that nature would be great.

My goal is to just find out if I would be able to see a significant performance boost by staying at the command line, rather then having the convenience of the desktop setting.

Thanks

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: How much processing power does OS use when in use?

Mon Feb 23, 2015 11:31 pm

Running at the command line will always be a lot faster than running a GUI. I'd say something along the lines of 4 to 1 processing power of GUI vs Command line. In many cases in Linux the GUI is just a front end to the command line anyway, so its still running the command line underneath the pretty GUI bit.

You'll notice it a lot more on a Pi rather than a Pi2 purely because the former being a much slower performer.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

gkreidl
Posts: 6126
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: How much processing power does OS use when in use?

Mon Feb 23, 2015 11:39 pm

Wrong question. You can easily run command line programs that take the full processing power of all 4 cores. I recently used a Python compiler that ran all 4 cores with full 100%.

On the other side, if you have started the desktop GUI and don't do much on it, it will only need a few percent of processor power.

It all depends on what you are doing and on the quality of the software,
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
PeterO
Posts: 5128
Joined: Sun Jul 22, 2012 4:14 pm

Re: How much processing power does OS use when in use?

Tue Feb 24, 2015 8:18 am

As a starting point you can look at the output from the "top" command. It will show the percentage of CPU time spent running your application and the time spent by the xserver updating the display. However your application will be spending some of its time doing things related to interfacing with the xserver which it may not have to do if it was only a command line application.

The actual potential gains will vary depending on how much output your app produces.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

cpc464
Posts: 218
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: How much processing power does OS use when in use?

Tue Feb 24, 2015 1:50 pm

The GUI will use very little CPU power while it is not doing anything. No more than a few %. However it will use some memory. If you start to move windows around a lot, open menus, click buttons - then the CPU usage will start to rise. Test it by running "top" in one window, while using your mouse to move windows around. As soon as your activity stops, the CPU usage should drop again.

So no, running the GUI isn't going to be a big CPU hog. (Unless you are logged in any playing Minecraft or whatever - that's a different story).
Unix engineer since 1989

Return to “Beginners”