The purpose of this article is to show, with respect to the supported platforms by MIDRES library, what is the average data transfer speed when reading a file sequentially from a random access storage (disk drive) using the standard C library1). The platform is then tested using models among those provided by the emulator, with the same process and the same dimensions.
This essay was born due to the need to expand the memory accessible to the software to reproduce isomorphic videoclip (IAV), so that it could be seen and exploited both from a real hardware machine and from an emulator.
The current version of the software already runs on all platforms and it uses (if available) a memory expansion. Currently, the only one available and documented is the REU for the Commodore 64/128. This provides an additional RAM memory with paged access and (on emulators) it is possible to “preload” a memory image from outside the emulator, which will then be accessible by any program (BASIC, C or ASM) that will go into execution later.
Having done a search on various Facebook groups for memory expansion models of the Commodore 264 line, I reluctantly discovered that this concept is not very common on Commodore (and other) 8-bit computers. Which is why I decided to check if accessing a disk device was fast enough to be seen as a memory “expansion”.
First of all, a simple empty data file was produced, of sufficient size to be able to read blocks in sequence. To produce this file it was sufficient to use the utility
dd of the Linux operating system, executed with these options:
dd if=/dev/zero bs=1024 count=25 of=zdata.dat
The options are:
if=/dev/zero : filename of the data source file to be produced (
/dev/zero is a special file that generates an unlimited series of “zero”);
bs=1024 : size of the block to generate (1024 bytes);
count=25 : number of blocks to generate (25);
ofs=zdata.dat : name of the destination file of the produced data.
With this command a 25 KB file was generated.
Then, I wrote a short program in C which takes care of making three (3) sequential readings of this file, each time using a doubled block size (compared to the previous one).
In particular, the following dimensions were used:
Time is measured using the internal clock called jiffy clock. This timer is incremented at a specific frequency by the system and, by counting the number of increments, the elapsed time can be measured with some approximation.
Since the number of “ticks” of the jiffy clock is a multiple of the screen refresh rate, it is possible that the time measures may not be “whole”. That is, the duration of 1 second could be approximated to, for example, 960 milliseconds or 1025 milliseconds.
To overcome this approximation, a reference measurement was performed for 1 second using the
mr_wait command, to guarantee the initial calibration: this involved the extraction of a specific multiplication factor, which then was applied to all the results.
Finally, the MIDRES library's
makefile has been adapted to generate a disk image for each platform that has a device of this type, and for each type of device that the emulator allows to simulate.
Below is a list of all the combinations generated:
*.d64); disk image
Each of these disk images were then loaded onto the emulator, thus letting it automatically identify the format and size of the media, and the relative benchmark was launched.
This diagram summarizes, briefly, the test's results:
Between the slowest configuration (VIC-20 expanded with a C=1571) and the fastest one (C=128 with C=1581) there is a ratio of 1:4, with the maximum speed of about 1653 bytes per second. The C=128 is still the computer that presents the best performance by direct comparison.
The Commodore 1541 proves to be one of the best of those produced by Commodore, while the fastest of all remains the ATARI drive.
The Commodore 128 is the best performing home computer model ever, followed by the ATARI computer. The worst remains, however, the VIC-20.