| OCR Text |
Show Each program was executed using three different types of code: hypothetical, host, and mixed. Using hypothetical code, the entire program was interpreted. Host code was executed as a regular compiled C program on the host. In mixed code, the top level function was in hypothetical code, while the rest of functions were in host code. Mixed code combines fast execution with the ability to use introspection, since host code can be replaced by hypothetical code if necessary. To support this replacement, at least a part of executed code must be hypothetical. Results are shown in Table 4.1. It can be observed that the interpretation of hypothetical code is around 50 to 100 times slower than the execution of the same program on the host. Using a mixed code approach, the overhead of hypothetical code is reduced to only 10 % to 20 %. Mixed code thus represents a good balance between the speed of host code and the introspective capabilities of hypothetical code. Functions that require introspection are interpreted, and the rest of routines are executed by the host. In the Stanford benchmarks 81,400,000 instructions were interpreted in 373.3 seconds, which means it takes around 4.5 //seconds to interpret an instruction in hypothetical code. No special optimization efforts were performed in the interpreter to achieve this speed. 81 Table 4.1. Execution Time Type of Code Hypothetical Host Mixed Stanford benchmarks Time in Seconds 373.3 3.4 3.8 Ratio to Host Code 110 1 1.12 Artificial Life Time in Seconds 13938.9 259.6 309.4 Ratio to Host Code 54 1 1.19 |