The next set of results evaluates the time to perform various RightSpeed operations. We performed these measurements on the AMD system, since accurately evaluating performance on the Transmeta system is difficult for two reasons: (a) the dynamic translation of code the chip performs can cause large differences from one run to another, and (b) confidentiality agreements preclude us from publishing certain measurements of the prototype system. In all cases speed changing was disabled to not confound the measurement of durations, so all runs are at 900 MHz. Most of these results we measured directly by making an entry in the log each time an operation started or stopped. However, some of them, such as intercepting a message, involve hidden overhead, so we measured them by running with and without the operation and subtracting. We ran each operation 10,100 times and discarded the first 100. Table 3 shows the mean results.
|
We see that the overhead of linking RSLib into each application is about 1.4 ms; this occurs only once per application, when it starts. Some of this is RSLib's initialization, including installing the message hook and opening the automatic task type group files, but this accounts for little of it. In these benchmarks, the application task type group file is in the file cache, but even if it were not the time to load would not be significantly more.
The overhead of hooking all messages delivered to applications is also
small. For non-user-interface messages, the overhead is 2.3 s
per message. For user interface messages, the message hook must
determine the event type and communicate that this task is beginning
and the previous task is ending to RightSpeed. The total extra time
is small, approximately 7.6
s per message. Considering that
messages arrive on the order of every few milliseconds, and that user
interface messages arrive even less often (at worst about every 14 ms
in the case of rapid mouse movement, and more typically about once
every 150 ms if the user is typing at 40 words per minute), the total
overhead is low.
RightSpeed operation microbenchmarks show more detail about the cause
of overhead. Each I/O control request takes about 1-2 s due to
the time to trap into kernel mode and to check and copy data from user
buffers to kernel buffers. Inside RSTask, the time to begin a task is
about 1.3
s and the time to end a task is about 1.1
s. The
most common operation, beginning one task and ending another that is
already considered complete, takes about 1.4
s of kernel time.
Note that this is less than the sum of the time to begin a task and to
end a task because of various optimizations for this case. For
example, we look up the task type group file only once and we acquire
and release the spin lock controlling access to the ongoing tasks list
only once.