During the development of fract I noticed a performance difference between win32 and linux by a factor of two or more. After doing some research on this I found that X11 cannot create a "hardware" surface. Using a hardware surface to draw on is critical for the performance, because if the surface is "software", the memory-to-VRAM copy is VERY slow. This means, the benchmark would spend nearly 50% of the time in framebuffer flipping, which is totally unconnected with the rendering itself. I thought that something has to be done.
After a little googling I figured out two methods of resolving the problem:
The DGA (Direct Graphics Access) X11 extension makes possible for the superuser to create hardware surfaces in fullscreen mode. DGA support is driver-specific and, with some drivers, may introduce lower framerates with DGA on. Note, that DGA may be unsupported and may even cause problems, e.g. resulting in system hang.
How to enable xfree86-dga:
# env SDL_VIDEODRIVER=dga ./fract
This will be used by default if fract is unable to obtain a hardware surface. In this case, it would check if your videocard supports hardware accelerated YUV surfaces (most videocards do). If not it falls back to "software" surface. Else it performs a few benchmarks to determine which is the fastest RGB-to-YUV conversion available. The conversion is usually fast, but it does cost time. Also, the YUV flip may be accelerated, but, with badly written drivers, it could be slower than real "surface flipping" under Windows.
Here's an example. I've got an ATI Radeon 9800 video adapter. The Windows version performs at 45 fps, while the Linux one (using the "radeon" driver) does only ~20 fps with software flipping and ~24 fps when using YUV overlay. The DGA is not helping.
Recently installed the ATI's closed source driver ("fglrx"). The "software" flipping version is faster, but still lags behind. Using DGA, I acheived 39 fps. Using overlay flipping I got 44 fps. Not bad?
So, if linux lags significantly, consider using the latest drivers available for your videocard.
Try using DGA, as YUV overlays usually result in coarser image quality. If you are a quality maniac you may explicitly tell fract not to use overlays, with --no-overlay option
If your driver incorrectly reports lack of hardware support for YUV overlays, use --force-overlay option.