Dhrystone

format_list_bulleted Contenido keyboard_arrow_down
ImprimirCitar

The Dhrystone is a small synthetic benchmark that is intended to be representative of whole systems programming. It is based on published statistics on the use of particular programming languages, operating systems, compilers, editors, etc.

History and general characteristics

The original publication of this benchmark can be seen in CACM 27.10 (Oct. 1984), 1013-1030, by Reinkol P. Weicker of Siemens-Nixdorf Information System. It was originally published in ADA, although most today use the C version distributed by Rick Richardson. Version 2 was published in SIGPLAN Notices 23.8 (Aug. 1988), 49-62, together with the measurement rules and in three languages: Ada, C and Pascal. Months later the latest version came out: 2.1. Version 1 is no longer recommended because current compilers can remove a lot of the "dead code" from the benchmark (however, the MIPS numbers quoted are often taken from version 1). Its name represents a play on words with its predecessor: Whetstone ("wet" = wet, "dry" = dry), its predecessor in the sense that it was also a representative mixture based on in existing programs, but the data was from scientific rather than commercial programs. One of its current uses is like other benchmarks; however, its low representativeness and its high sensitivity to compilers and optimizations discourage its use. It is a synthetic and commercial benchmark. Result: It tries to measure the speed of the system in terms of non-numerical performance, expressing the results in DPS (Dhrystones Per Second). Dhyrstone yield is calculated from the following formula: Dhrystone iterations per second = processor clock * number of passes / execution time. For the result to be valid, the Dhrystone code must be executed for at least two seconds.

Features

Contains many simple instructions, procedure calls and conditionals, and a few floating point and loops. It does not make system calls. It uses few global variables and performs operations with pointers. It is made up of 12 procedures included in a measurement loop with 94 sentences. Its size cannot be changed. It is made up of 53% assignment instructions, 32% control instructions, and 15% procedure calls. Dhrystone is compact (no more than 1.5KB), widely available in the public domain, and easy to run. Because Dhrystone is so small it completely enters the internal cache, thus it does not measure the rest of the system but it has the advantage that it only measures the capacity of the processor to work with integers. The Dhrystone compares processor performance using a benchmark machine: the VAX 11/780 is the machine that runs at 1 MIPS (achieves 1757 Dhrystones per second). It cannot be parameterized, unlike Whetstone where the different types of instructions are in loops, here they do not exist, so the importance of each type of instruction cannot be changed by changing the number of times each loop is iterated.

Problems

A considerable percentage of the time is spent on string handling functions, which makes the test very dependent on the way these operations are executed (such as inline code, routines written in assembly language, etc.). In short, it is very susceptible to optimizations of critical routines by manufacturers. The Dhrystone actually reflects the performance of the compiler and its libraries rather than the processor itself. In particular, Dhrystone contains two instructions in which the programming language and its translation take the most execution time: a string assignment (in procedure Proc_0 / main) and a string comparison (in function Func_2).. On the VAX 11/785 with Berkeley UNIX (4.2) the compilers spent 23% of the time on these string functions. On RISC machines (where less time is spent on procedure call sequences than on the VAX) and with better optimizing compilers, the percentage ranges from 21% to 65%, clearly above typical applications today. It is very unlikely that there are applications that have such a significant proportion of C library usage or even specific library calls. String handling is very different in Ada and Pascal, where strings are part of the language, this is why running in C always gives worse results and spends so much time on them (it was designed considering Ada's abilities to handle strings).).

Lack of certification

There is no certification process required to cite Dhrystone results. This is an advantage in terms of the ease of working with the results, but a disadvantage in the fact that one must carefully examine these results when they are external before reaching any conclusions.

Compiler Efficiency

Key to Dhrystone is the dependency on the compiler and the library technology used - far more than any other benchmark. Differences of up to 100% have been found with the same machine but different compilers ANSI-C Instead of using the normal Kernighan & Ritchie (K&R) many times the code is altered to comply with ANSI formats. This change can give much more information to the compiler, which leads to better optimization.

Merge Source Files

Combining the two source files into one module enables the compiler to run additional optimizations on all functions simultaneously.

Inline code

Enabling procedure inlining can improve performance. With the availability of ANSI C the definition of the string function was not part of the language; now yes, with what is allowed to explicitly inline the library functions. The Dhrystone rule "Do not inline in procedures for Dhrystone" it refers only to the level of user procedures and not to the level of library routines.

How to measure the result

It is based on the processor clock and the amount of time it runs is too short (just over 2 seconds). Tailoring C libraries to speed up Dhrystone code can drastically alter benchmark results, although this can negatively impact typical code performance.

What to ask yourself before using Dhrystone for comparison purposes

  1. What version of Dhrystone was used?
  2. What source code was used (ANSI or K fakeR not modified)?
  3. How many build modules were used (two separate or one single)?
  4. What line configuration was applied?
  5. What C libraries are used?
  6. What tool chain (compiler version, options, linker) was used?
  7. What's the CPU clock speed?
  8. What platform was used (simulator, real hardware)?
  9. What reference number was used (if not the VAX 11-780 = 1757)?

Dhrystone source code

The source code consists of two files, one containing the main program and the definition of procedures and functions, in the second there are compiler directives and simple instructions. The program itself executes a loop a number of times such that the execution time reaches 2 seconds. Within the loop, assignments are made, calls to the different procedures (which have different types of instructions), pointer definitions, and finally, the data is written to the screen so that there is no "dead code". Before displaying it on the screen, it stops the clock in order to obtain the time it consumes and thus calculate the DPS.

  • Wd Data: Q1207761
Más resultados...
Tamaño del texto:
undoredo
format_boldformat_italicformat_underlinedstrikethrough_ssuperscriptsubscriptlink
save