SSD6 Multiple-Choice Quiz 4-阿里云开发者社区

开发者社区> 大数据> 正文

SSD6 Multiple-Choice Quiz 4

简介: 【ssd6 quiz 4 做了6次 】                           1.To quickly allocate and free many variables of a commonly used data type, we could   (a) minimize the size of the data type.

【ssd6 quiz 4 做了6次 】

 

     

      

        

 

1.To quickly allocate and free many variables of a commonly used data type, we could  
 (a) minimize the size of the data type.
 (b) coalesce blocks when they are freed.
 (c) use sizes which are powers of two.
 (d) keep a linked list of free objects of that type's size.

Correct answer is  (d)
 
2."CPU time" measures  
 (a) the percentage utilization of the CPU by the system.
 (b) the time spent executing system functions.
 (c) the time spent by a program executing program instructions.
 (d) wall time

Correct answer is  (c)
 
3.Which of the following are useful for observing program performance?
I. Direct measurement with a stopwatch.
II. Statistical Sampling.
III. System Monitors
 
 (a) I, II, and III
 (b) I and III only
 (c) I and II only
 (d) II and III only

Correct answer is  (a)
 
4.Amdahl's law, applied to program optimization, says that  
 (a) algorithmic design is more important than code quality for performance
 (b) program measurement is a prerequisite to optimization
 (c) each optimization about doubles a program's performance
 (d) successive program optimizations tend to produce diminishing returns
Correct answer is  (d)
 

2."Wall time" measures  
 (a) the total duration of a program's execution.
 (b) idle time.
 (c) the user time plus the system time.
 (d) the time a program spends waiting for input and output.

Correct answer is  (a)
 
3.Which of the following are advantages of using statistical sampling to profile programs?
I. Exact run times of all functions can be determined.
II. Code can be instrumented automatically.
III. The performance impact due to measurement can be minimal.
 
 (a) I and III only
 (b) II and III only
 (c) I and II only
 (d) I, II, and III

Correct answer is  (b)
 

4.Which of the following is likely to offer the best performance improvement for programs that spend 50% of their time comparing strings?  
 (a) Be sure to use hardware string-comparison instructions.
 (b) Call a library function for string comparison.
 (c) Store strings uniquely so that pointer comparison can be used.
 (d) Write in-line code for string comparison to eliminate a procedure call.
Correct answer is  (c)

 

1.A memory pool is a large block of memory from which small objects are allocated piecemeal by breaking them off from the pool as required. Under which of the following conditions would such a scheme result in greatly improved performance?
I. All objects allocated from the pool are freed at around the same time.
II. All objects allocated from the pool are of similar sizes.
III. A garbage collector takes care of freeing memory.
 
 (a) II only.
 (b) I only.
 (c) I and II only.
 (d) III only.

Correct answer is  (b)

版权声明:本文首发在云栖社区,遵循云栖社区版权声明:本文内容由互联网用户自发贡献,版权归用户作者所有,云栖社区不为本文内容承担相关法律责任。云栖社区已升级为阿里云开发者社区。如果您发现本文中有涉嫌抄袭的内容,欢迎发送邮件至:developer2020@service.aliyun.com 进行举报,并提供相关证据,一经查实,阿里云开发者社区将协助删除涉嫌侵权内容。

分享:
大数据
使用钉钉扫一扫加入圈子
+ 订阅

大数据计算实践乐园,近距离学习前沿技术

其他文章