When sampling, the Stats tool installs an interrupt-service routine that relies on the timely delivery of asynchronous messages from the system timer. Accessors and system primitives do not check for asynchronous messages. As a result, the time spent in accessors and system primitives is recorded in the first timer tick after the accessor or system primitive has exited. The time is charged to the next method that checks for asynchronous messages.When this code fragment is sampled S], the time spent in the system primitive operation replaceFrom:to:with:startingAt: is incorrectly charged to isMemberOf:, because isMemberOf: is the first method that checks for asynchronous messages after the primitive operation.
|