Check out the new USENIX Web site. next up previous
Next: Effect on performance Up: Results Previous: General overhead

Time to perform RightSpeed operations

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.


Table 3: Average time RightSpeed takes to perform common operations on the AMD machine at 900 MHz
Operation Time
Load and initialize RSLib for a process 1.401 ms
Install message hook 8.532 $ \mu$s
Open system auto task type group file 159.777 $ \mu$s
Get application name 12.583 $ \mu$s
Open per-app auto task type group file 121.229 $ \mu$s
Intercept non-user-interface message 2.265 $ \mu$s
Intercept & handle user interface message 7.605 $ \mu$s
Evaluate message type 1.013 $ \mu$s
End task and begin another 3.575 $ \mu$s
Simple I/O control request to RSTask 1.162 $ \mu$s
Begin a task 3.450 $ \mu$s
Kernel-mode component 1.345 $ \mu$s
End a task 2.530 $ \mu$s
Kernel-mode component 1.134 $ \mu$s
End one task and begin another 3.462 $ \mu$s
Kernel-mode component 1.441 $ \mu$s


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 $ \mu$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 $ \mu$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 $ \mu$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 $ \mu$s and the time to end a task is about 1.1 $ \mu$s. The most common operation, beginning one task and ending another that is already considered complete, takes about 1.4 $ \mu$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.


next up previous
Next: Effect on performance Up: Results Previous: General overhead
Jay Lorch 2003-02-19