Performance

From DOSBoxWiki
Jump to navigationJump to search

DOSBox emulates the CPU, the sound and graphic cards, and other peripherals of a PC, all at the same time. The speed of an emulated DOS application depends on how many instructions can be emulated, which is adjustable (number of cycles).

How to speed up/slow down DOSBox

CPU Cycles (speed up/slow down)

By default (cycles=auto) DOSBox tries to detect whether a game needs to be run with as many instructions emulated per time interval as possible (cycles=max, sometimes this results in game working too fast or unstable), or whether to use fixed amount of cycles (cycles=3000, sometimes this results in game working too slow or too fast). But you can always manually force a different setting in the DOSBox's configuration file.

You can force the slow or fast behavior by setting a fixed amount of cycles in the DOSBox's configuration file. If you for example set cycles=10000, then DOSBox window will display a line "Cpu Speed: fixed 10000 cycles" at the top. In this mode you can reduce the amount of cycles even more by hitting CTRL-F11 (you can go as low as you want) or raise it by hitting CTRL-F12 as much as you want, but you will be limited by the power of one core of your computer's CPU.

You can see how much free time your real CPU's cores have by looking at the Task Manager in Windows 2000/XP/Vista/7 and the System Monitor in Windows 95/98/ME. Once 100% of the power of your computer's real CPU's one core is used, there is no further way to speed up DOSBox (it will actually start to slow down), unless you reduce the load generated by the non-CPU parts of DOSBox. DOSBox can use only one core of your CPU, so If you have for example a CPU with 4 cores, DOSBox will not be able to use the power of three other cores.

You can also force the fast behavior by setting cycles=max in the DOSBox configuration file. The DOSBox window will display a line "Cpu Speed: max 100% cycles" at the top then. This time you won't have to care how much free time your real CPU's cores have, because DOSBox will always use 100% of your real CPU's one core. In this mode you can reduce the amount of your real CPU's core usage by CTRL-F11 or raise it with CTRL-F12.

CPU Core (speed up)

On x86 architectures you can try to force the usage of a dynamically recompiling core (set core=dynamic in the DOSBox configuration file). This usually gives better results if the auto detection (core=auto) fails.

It is best accompanied by cycles=max. But you may also try using it with high amounts of cycles (for example 20000 or more). Note that there might be games that work worse/crash with the dynamic core (so save your game often), or do not work at all!

Graphics emulation (speed up)

VGA emulation is a demanding part of DOSBox in terms of actual CPU usage. Increase the number of frames skipped (in increments of one) by pressing CTRL-F8. Your CPU usage should decrease when using a fixed cycle setting, and you will be able to increase cycles with CTRL-F12. You can repeat this until the game runs fast enough for you. Please note that this is a trade-off: you lose in fluidity of video what you gain in speed.

Sound emulation (speed up)

You can also try to disable the sound through the setup utility of the game to reduce load on your CPU further. Setting nosound=true in DOSBox's configuration does NOT disable the emulation of sound devices, just the output of sound will be disabled.

Also try to close every program but DOSBox to reserve as much resources as possible for DOSBox.

Advanced cycles configuration

The cycles=auto and cycles=max settings can be parameterized to have different startup defaults. The syntax is

 cycles=auto ["realmode default"] ["protected mode default"%]
             [limit "cycle limit"]
 cycles=max ["protected mode default"%] [limit "cycle limit"]


Example:

 cycles=auto 5000 80% limit 20000

This will use cycles=5000 for real mode games, 80% CPU throttling for protected mode games along with a hard cycle limit of 20000

Emulated CPU equivalency

Rough speed equivalent of emulated CPU for different host CPUs. For core=dynamic (cycles=max), while core=normal may to be 10 times slower.

Host CPU Emulated CPU
Pentium II 400 MHz 386
Duron 800 MHz 486
Pentium III 1.0 GHz 486
Intel Atom 1.6 GHz 486
Pentium III 1.4 GHz Pentium 75 MHz
Pentium 4 3.0 GHz Pentium 166 MHz
Pentium M 1.8 GHz Pentium II
Athlon XP 1.8 GHz Pentium II
Athlon 64 1.8 GHz Pentium III
Core 2 Duo 1.8 GHz Pentium III
Core i5/i7 4xxx 4.4 GHz Pentium III 1 GHz
Apple G3 500 MHz 386
Apple G4 1.0 GHz 486

See also