Suppose that in-memory pointers are either not followed (probability 1 - p) or are followed k times (probability p) . For what values of k and p do not swizzling, automatic-swizzling, and on-demand-swizzling each offer the best average performance
Answers
Answered by
0
n = No.of pointers p = Probability k = No. of times to follow the pointer. No Swizzling: Total performance = n * p * k * 10 = 10 npk Automatic Swizzling: Cost to swizzle n pointers = 20 * n No.of Pointers * Time to follow 1 swizzled pointer * No.of times to follow the pointer * Probability of following it = npk Hence the total time (auto-swizzling+following) = 20n + npk.
Similar questions
English,
6 months ago
Math,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Chemistry,
1 year ago
Social Sciences,
1 year ago