Difference between revisions of "Performance"
m (Changed protection level for "Performance" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Revision as of 16:17, 17 February 2020
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"]
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
It's rough speed level of emulated CPU for different host CPUs. For core=dynamic (cycles=max), while core=normal may to be 5 times slower. Different applications, even their parts, may have different this dependency. An application's and the emulator's settings affect too, - for example, sound's settings.
|Host CPU||Emulated CPU|
|Pentium Pro 200 MHz||286 6 MHz|
|Pentium II 350 MHz||386SX 25 MHz|
|Pentium III 1.0 GHz||486 66 MHz|
|Pentium 4 3.0 GHz||Pentium 133 MHz|
|Core 2 Duo 3.3 GHz||Pentium II 300 MHz|
|Core i5 4xxx 4.0 GHz||Pentium III 500 GHz|
Note: Based on Speed Test 1.14 and other.
Rough dependency between cycles and emulated CPU. Different applications, even their parts, may have different this dependency.
|8088 4.77 MHz||315|
|286 12.5 MHz||2750|
|386 33 MHz||7800|
|486 66 MHz||26800|
|Pentium II 300||200000|
Note: Based on Speed Test 1.14