Skip to main content

Esitmating emulators performance

Performance testing#

To measure performance we used a variant of Dhrystone 2 Test originally taken from this page. Original version used clock() to calculate delta time. Which is good for a real pc, but is not very accurate for a dosbox emulator. When the clock() call happened, a modified version sends ~>dtime marker to stdout which is intercepted by the test page and used to calculate delta time with from the browser. Source code of the modified test is here.

Basically this test produces a lot of int operations and measures the amount of operations (Dhrystones) produced per second. Output is a VAX MIPS RATING which is Drhystones per second divided by 1757 (is as DEC VAX 11/780 result).

js-dos bundle with this test can be found on Test page.

Running the test#

Example output:


Implementing the test#

To run this test we should use emulators.js (from emulators) and use our js-dos bundle to start the test.

<script src="/v7/build/releases/latest/emulators/emulators.js"></script>
// ...
emulators.pathPrefix = "/v7/build/releases/latest/emulators/";

You can start test in worker or direct mode:

// promise is resolved when emulator is started
const ci = await (options.worker ?
emulators.dosWorker(bundle) :

In worker mode each test will run in a new worker. If you press Start Worker multiple times, then you will see output from multiple threads. In direct mode the browser will probably hangs. In theory direct mode is faster, but browser will be unstable. Our recommendation is to use worker mode all time.

Complete example: