Linux 3D Games Run Faster On PC-BSD
koinu writes "Phoronix has published benchmarks comparing 3D game performance on Ubuntu Linux 11.04 with the FreeBSD Linux ABI emulation on the 8.2 release of PC-BSD, which is a desktop variant of FreeBSD. Most results show that the emulated Linux layer on FreeBSD performs better than Linux natively. It's pretty interesting, because most people would expect that an additional abstraction layer would generally slow down the execution of binaries."
This is likely caused by Compiz interacting with the game engine on Ubuntu. Turn Compiz off and re-run the benchmarks.
some 10 years ago, when even the slightest hiccup could make a game running in linux slow to a crawl (not linux's fault. more like greedy games on average hardware), i ran several tests to find the best settings for performance. here's what i found:
- even a lightwheight window manager like windowmaker, fluxbox or xfce impacts negatively (specially if you're short on RAM) .Xsession file with nothing more than "xterm" on it. as soon as X starts with a windowless xterm, run the game from the CLI.
- any cute widget, dockapp or systray app can take a hit. a simple opengl cpu meter, displaynig a spinning cube, running inside a 64x64 dockapp had a 10% hit on glxgears' frame rate
- daemons started from init.d scripts steal memory, and if they trigger a backgroud process, bye-bye performance. so make sure anything than trigger lots of disk I/O operations are off. specially if they run from cron
- get used to the command line. shut down GDM/KDM/XDM or any other graphical login. log on the console, quickly create an
now, optimize BOTh PC-BSD and linux this way, THEN run a benchmark. otherwise, is the same as trying to compare a default ubuntu with openBSD on which one is more secure. or the other way on which is more usefull as a desktop. it's not right to ebnchmark different OSes by leaving the defaults just like that.
What ? Me, worry ?
If BSD can emulate linux faster than linux can run, something is very, very bad going on.
Why? It just means BSD is faster somewhere than Linux, that's all.
Nothing is "emulated." Wine does not "emulate" windows, either. Wine supplies a dynamic link loader that brings up PE executables. It also supplies a set of libraries for Windows-- Wine is a Windows re-implementation. It comes with an msvcrt that supplies strcpy() and strlen() and open() and such. It comes with kernel32.dll. It comes with everything.
Unix systems that have other Unix system execution layers basically keep an additional syscall table around. BSD loads a Linux ELF executable, recognizes it's for 32-bit Linux, and sets its syscall entry point to the Linux table. All POSIX functions mostly route to BSD's innards, just like the native BSD table. A few tricky things supply a little translation layer--we might see data come by in format [xxx][yyyy][zzz] and we expect it in [xxx][pad][yyyy][zzzz] so it's padded properly, or something equally as banal. Some specialized functions are implemented for Linux, using BSD facilities to approximate.
In the end, you have an operating system that capably loads binaries under a specific API, not an emulator.
Support my political activism on Patreon.